Modal
Modal helps to focus the user’s attention on one task or piece of information via a window that sits on top of the page content.
- Storybook (opens in a new tab)
- Figma library (opens in a new tab)
- Figma spec (opens in a new tab)
npm install @sbks/ds-modal
Dimensions and spacing
Section titled “Dimensions and spacing”The dialog sits in the center of the screen. Once a scrollbar appears in the advanced layout, the content keeps the same inset as without it.
| Part | Property | Token |
|---|---|---|
| Dialog | Minimum width | 420px |
| Dialog | Corner radius | --border-radius-large |
| Body | Gap between blocks | --space-4 |
| Advanced header | Padding | var(--space-5) var(--space-6) |
| Advanced body | Padding | --space-6 |
| Advanced body | Padding with a scrollbar | --space-6 |
Colors
Section titled “Colors”In the advanced layout, the scrollable body has its own background on top of the dialog background.
| Part | Property | Token |
|---|---|---|
| Dialog | Background | --color-layer-level-1 |
| Dividers | Border | 1px solid var(--color-border-primary) |
| Advanced header | Text | --color-on-layer-primary |
| Advanced body | Background | --color-layer-level-0 |