Agriculture Design System
Beta
Design System for the Export Service

Modal

A modal is a dialog box that appears above the parent page and provides advance notice of a destructive action and consequence. They tell users a decision is needed.

View in FigmaView in StorybookView in Github
import { ... } from '@ag.ds-next/react/modal';

Usage

Modal components can be imported via the modal entrypoint in the @ag.ds-next/react package.

For example:

import { ... } from '@ag.ds-next/react/modal';

Props

Modal Props
PropTypeDescription
titlestring
The title of the modal dialog. It can span lines but should not be too long.
actions?ReactNode
The actions to display at the bottom of the modal panel. Typically a `ButtonGroup`.
children?ReactNode
isOpen?booleanDefault: false
If true, the modal will be rendered.
onClose?(() => void)
Function to be called when the 'Close' button is pressed.
onDismiss?(() => void)
@deprecated use `onClose` instead

Source

You can view the full source code for this package on Github.