monday-ui-react-core
Version:
Official monday.com UI resources for application development in React.js
103 lines (74 loc) • 2.78 kB
text/mdx
import { ComponentRules, UsageGuidelines } from "vibe-storybook-components";
import { Story, Canvas, Meta } from "@storybook/blocks";
import { DIALOG, TIPSEEN, TOOLTIP } from "../../../storybook/components/related-components/component-description-map";
import {
DialogAsModalBadExample,
ModalExampleWrapper,
TipAlertDialog,
TipDevDropdownInsideModal,
TipDialog
} from "./Modal.stories.helpers";
import * as ModalStories from "./Modal.stories";
<Meta of={ModalStories} />
- [Overview](
- [Props](
- [Usage](
- [Variants](
- [Do’s and don’ts](
- [Use cases and examples](
- [Related components](
- [Feedback](
Modal allows the user to focus on one task or a piece of information, by popping-up and blocking the page content until the modal task is completed, or until the user dismisses the action.
Use modal for short and non-frequent tasks. For common tasks consider using the main flow.
<Canvas of={ModalStories.Overview} />
<PropsTable />
<UsageGuidelines
guidelines={[
"Modals appear centered on the page, with a visible backdrop dimming the rest of the page for focus.",
"Modals height is dynamic according to its content.",
"All modals must have a title and a close button",
"By default, Modal will be closed by: clicking outside, the ESC key and the closing buttons."
]}
/>
<TipAlertDialog />
<br />
<TipDialog />
<Canvas of={ModalStories.Sizes} />
Use the ModalHeader component to display a Header with an icon
<Canvas of={ModalStories.ModalWithIcon} />
Use the <code>alertDialog</code> boolean prop in order to allow closing the modal only by the close buttons and not by ESC or by
clicking outside. Use this variant in case of sensitive or important messages, and in modals that requires data from the user, such as forms.
<Canvas of={ModalStories.AlertModal} />
<ComponentRules
rules={[
{
positive: {
component: (
<ModalExampleWrapper bestPractice modalTitle="Modal title" buttonTitle="Click here">
Modal content
</ModalExampleWrapper>
),
description: "Modal must include backdrop element."
},
negative: {
component: <DialogAsModalBadExample />,
description: "Don't remove the backdrop element of the modal or the modal's title."
}
}
]}
/>
<TipDevDropdownInsideModal />
<Canvas of={ModalStories.ModalWithEditableTitle} />
<RelatedComponents componentsNames={[TOOLTIP, DIALOG, TIPSEEN]} />