Toast
The Toast component provides a reusable pattern for toast in the interface.
Basic
Basic toast examples.
API
| Parameter | Default | Description |
|---|---|---|
|
position
|
bottom-left | Position of the toast: top-left, top-right, bottom-left, bottom-right. |
Subcomponents
Toast Item
Type of notice: success, warning, danger, info.
| Parameter | Default | Type | Purpose |
|---|---|---|---|
|
type
|
info | string | Type of notice: success, warning, danger, info. |
|
message
|
[] | array|object | An array with two parameters: title and text |
|
icon
|
false | array | The icon according to the @icon component. |
|
stretch
|
false | boolean | If true, the notice will stretch to the full width of the viewport. |
|
dismissable
|
false | boolean|string | If not false, the notice will have a close button. Allowed trueish values: immediate (show notice on reload), session (show notice at next visit, default), permanent (show notice when local storage is wiped). |
|
action
|
false | array|boolean | An array with three parameters: label (text), url and position (aside|below). |
|
classList
|
[] | array | Additional CSS classes added to the wrapping element. |
|
attributeList
|
[] | array | Additional HTML attributes added to the wrapping element. |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-toast--base
|
var(--base) | range | - | Main unit that drives radius and spacing scales. |