rokle

Personality

20
40
70
15

Active brand: Meridian

Adjust sliders to see every component on the page respond in real time.

Toast

Ephemeral feedback notification. Auto-dismissing with aria-live.

Examples

All variants

Trigger default, success, error, and action toasts. Toasts auto-dismiss after 4 s.

Warning

Warning variant for caution or threshold alerts. Uses warning colour tokens.

With title

Title and description layout for richer notifications. Title inherits the variant colour, description uses secondary text.

Persistent (closable)

Toast that stays until the user explicitly dismisses or takes action. No auto-dismiss timer.

Positions

Choose where toasts appear along the bottom edge. Select a position and trigger a toast to see it.

Installation

pnpm add @rokle/components @rokle/tokens

Installs with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.

Usage

import { Toast } from "@rokle/components";
import { Toast } from "@rokle/components";

export function Example() {
  return <Toast />;
}

API Reference

PropTypeDefaultDescription
titlestring-Optional bold heading above the message.
messagestring-Notification text.
variant"default" | "success" | "error" | "warning""default"Visual style.
durationnumber4000Auto-dismiss time in ms. Set persistent: true to disable.
persistentbooleanfalseWhen true, toast stays until manually dismissed.
position"bottom-right" | "bottom-center" | "bottom-left""bottom-right"Screen position for the toast container.