Default

import { Modal } from '@davaux/ui'

<Modal
  triggerLabel="Open modal"
  title="Modal title"
  body="This is the modal body content."
/>

Sizes

<Modal triggerLabel="Small" title="Small modal" size="sm" body="..." />
<Modal triggerLabel="Medium" title="Medium modal" size="md" body="..." />
<Modal triggerLabel="Large" title="Large modal" size="lg" body="..." />

Centered

<Modal
  triggerLabel="Open centered"
  title="Centered modal"
  body="Vertically centered in the viewport."
  centered
/>

Full screen

<Modal
  triggerLabel="Open fullscreen"
  title="Fullscreen modal"
  body="Covers the entire viewport."
  fullScreen
/>

Props

PropTypeDefaultDescription
openedbooleanfalseInitial open state (SSR)
titlestringModal header title
bodystring''Modal body text
triggerLabelstringRenders a built-in trigger button with this label
size'xs'|'sm'|'md'|'lg'|'xl'|'auto'|'full''md'Modal content width
centeredbooleanVertically centers the modal in the viewport
fullScreenbooleanExpands the modal to fill the viewport