GitHubGitHub
← All components
Feedback / component

Toast

A compact semantic notification with optional dismissal.

InfoSuccessWarningDanger
Configuration saved

The live dashboard is using the new thresholds.

Connection delayed
<Toast title="Configuration saved" tone="success" />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Toast } from '@chanrg/4ui';<Toast title="Configuration saved" tone="success" />

API reference

Props

PropTypeDefaultDescription
titlestringrequiredNotification heading.
toneinfo | success | warning | dangerinfoSemantic treatment.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Uses a live status region.

Dependencies

No runtime component dependencies.