Components / Overlays

Alert

A confirmation dialog (role=alertdialog) with intent and Cancel/Confirm.

@ruckc/truss-ui Overlays

Import

import { Alert } from '@ruckc/truss-ui';

Playground

intent

API

PropTypeDefaultDescription
open bindable booleanfalseWhether it is open. Bind it with `bind:open`.
title required string—Heading text.
intent 'primary' | 'warning' | 'danger''primary'Semantic colour: `primary`, `neutral`, `success`, `warning` or `danger`.
confirmLabel string'OK'Label of the confirm button.
cancelLabel string—Omit for a single-button acknowledgement.
onconfirm event() => void—Called when the user confirms.
oncancel event() => void—Called when the user cancels.
children required snippet Snippet—Content, as a Svelte snippet.
/docs/alert Truss UI · MIT