Components
Dialog
Dialogs present focused content or actions in a modal overlay above the main page.
Stable
GitHubAnatomy
Anatomy
import {Dialog} from '@staffbase/design';
<Dialog.Root>
<Dialog.Trigger />
<Dialog.Popup>
<Dialog.Header>
<Dialog.Title />
<Dialog.Close />
</Dialog.Header>
<Dialog.Body>
<Dialog.Description />
</Dialog.Body>
<Dialog.Footer />
</Dialog.Popup>
</Dialog.Root>API reference
Root
Inherits props fromBase UI Dialog Root
Trigger
Inherits props fromBase UI Dialog Trigger
| Name | Type | Description |
|---|---|---|
children | ReactNode | Opens the dialog when activated. Passed as a single button element, not via a render prop. |
Close
Inherits props fromBase UI Dialog Close
| Name | Type | Description |
|---|---|---|
children | ReactNode | The element that closes the dialog. Passed as a single button element, not via a render prop. |
Popup
Inherits props fromBase UI Dialog Popup
| Name | Type | Description |
|---|---|---|
children | ReactNode | The content of the dialog, typically a header, body, and footer. |
container | HTMLElementRefObject<HTMLElement> | Use this instead of z-index to specify another parent element to render the dialog portal into. Default is the document body. |
Header
| Name | Type | Description |
|---|---|---|
children | ReactNode | The header content, typically a title and a close button. |
Body
| Name | Type | Description |
|---|---|---|
children | ReactNode | The main content of the dialog. |
Footer
| Name | Type | Description |
|---|---|---|
children | ReactNode | The footer content, typically action buttons. |
Title
Inherits props fromBase UI Dialog Title
| Name | Type | Description |
|---|---|---|
children | ReactNode | A heading that labels the dialog. |
Description
Inherits props fromBase UI Dialog Description
| Name | Type | Description |
|---|---|---|
children | ReactNode | A description that provides additional context for the dialog. |
When to use
When not to use
How to use
Structure
Title
Body content area
Header
Edit profile photo
Dialog content
Footer
Scrolling
Layout & responsive behavior
Closing
Title
Provide both a header close button and a footer Cancel action so users always have an obvious way out.