Skip to content
Feedback & Data

DialogMorph

The button itself grows into the dialog and shrinks back into place on close. Focus stays inside while open, Esc or a click outside closes, and focus returns to the button.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
triggerReactNodeโ€”Button label.
titlestringโ€”Dialog heading. Also its name for screen readers.
descriptionstringโ€”Small text under the heading.
childrenReactNode | (close) => ReactNodeโ€”Dialog body. Use the function form to close from your own buttons.
containedbooleanfalseStay inside the nearest positioned parent instead of the screen.
triggerClassNamestringviolet buttonReplaces the button look.
classNamestringdark panelReplaces the dialog look.