You are viewing a PR preview for PR #1506

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
onDismiss() => voidFunction to be called when the modal is closed.
titlestringThe title of the modal dialog. It can span lines but should not be too long.
actions?ReactNodeThe 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.

Source

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