Components/Feedback/Alert

Alert

Feedback

Inline status message with icon, title, body, and dismiss button.

In-page status message with a semantic icon determined by tone. Supports solid and subtle variants. Optional dismiss callback and action slot for a CTA button.

Usage

import { Alert } from "nosible-ux"

export default function Example() {
  return (
    <Alert
      tone="success"
      variant="subtle"
      title="Signals exported"
      description="1,240 signals have been exported as CSV."
    />
  )
}

Examples

All tones

Solid with dismiss and action

Accessibility

role="alert" so screen readers announce the content when it appears. Dismiss button has aria-label="Dismiss". The icon is aria-hidden.

Props

Name TypeDefaultDescription
action
ReactNodeOptional action element (typically `<Button intent="ghost">`).
description
ReactNodeAlert body copy.
onDismiss
(() => void) | undefinedWhen provided, renders a trailing × dismiss button.
title
ReactNodeAlert heading — omit to make description the primary text.
tone
Tone | undefinedSemantic tone. Controls icon, colour, and left-stripe. Default: `"info"`.
variant
AlertVariant | undefinedVisual style. `"solid"` fills the surface; `"subtle"` uses a left stripe. Default: `"solid"`.