Modal
The Modal component provides a reusable pattern for modal in the interface.
Modal
Modal with navigation
Click any thumbnail to open the gallery modal. Previous and next arrows cycle through images.
API
| Parameter | Default | Description |
|---|---|---|
|
heading
|
The title of the modal | |
|
slot
|
The main content of the modal | |
|
bottom
|
Extra slot at the bottom of the modal (below content) | |
|
overlay
|
light | - |
|
isPanel
|
false | Removes padding, to enable a panel like behaviour. Cover whole page viewport. |
|
id
|
A unique id which will be used to target the modal to open with the correct data-attr | |
|
animation
|
slide-up | Available animations: slide-up, slide-down, slide-left, slide-right. |
|
navigation
|
false | Adds navigation arrows, to slide between stuff. |
|
size
|
Empty as default is set to max width 800px. But you can use sm, md and lg | |
|
padding
|
3 | Adds whitespace around the content. Value: 1 - 4 |
|
borderRadius
|
false | Rounded edges. Value: sm, md, lg |
|
transparent
|
false | Transparent wrapper around the content |
|
closeButtonText
|
Text for the close button. Default is empty |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-modal--base
|
var(--base) | range | - | Main unit that drives radius and spacing scales. |
|
--c-modal--space
|
var(--space) | range | - | Base spacing unit. Used for padding and margin inside components. |
|
--c-modal--border-width
|
var(--border-width) | range | - | Size |
|
--c-modal--border-radius
|
var(--border-radius) | range | - | Border Radius |
|
--c-modal--color--surface
|
var(--color--surface) | color | - | Surface |
|
--c-modal--color--alpha
|
var(--color--alpha) | rgba | - | Used for overlays. Includes opacity — set both color and alpha together. |
|
--c-modal--color--surface-contrast
|
var(--color--surface-contrast) | color | - | Used for text and icons on surface backgrounds with less contrast. |
|
--c-modal--corner-shape
|
var(--corner-shape) | select | square, round, squircle, circular, bevel, scoop | Corner Shape |
|
--c-modal--shadow-color
|
var(--shadow-color) | rgba | - | Shadow Color |
|
--c-modal--shadow-amount
|
var(--shadow-amount) | range | - | Multiplier for elevation shadows. 0 = none, 1 = default. |
|
--c-modal--color--alpha-contrast
|
var(--color--alpha-contrast) | color | - | Used for text and icons on alpha overlays. |
|
--c-modal--color--surface-border
|
var(--color--surface-border) | color | - | Manual companion token for borders on surface elements. |
|
--c-modal--font-size-500
|
var(--font-size-500) | range | - | Four steps above base in the type scale. Equivalent to h3. |