AsterUIDocsv1.0.2

Docs / Component reference

Alert & Banner

Put an explanation next to the action that caused it. An alert can carry a recovery action or a dismiss button.

Alert example

Install

sh
npx @fierst/ui@1.0.2 add alert

Registry dependencies: theme, icon. Package dependencies: @lucide/icons.

Exports from ./ui/alert: AlertTone, Alert, Banner.

Download the registry source for alert 1.0.2.

API contracts

ts
export type AlertTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';

export function* Alert(
  props: {
    tone?: AlertTone;
    title?: string;
    description?: string;
    action?: View;
    dismissible?: boolean;
    banner?: boolean;
    onDismiss?: () => void;
    class?: string;
    children?: View;
  },
  ctx: Ctx,
)

export function Banner(props: {
  tone?: AlertTone;
  title?: string;
  description?: string;
  action?: View;
  dismissible?: boolean;
  onDismiss?: () => void;
  class?: string;
  children?: View;
})