Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Alert

A callout that tells the reader something worth their attention.

Rendered by React 19.3.1

alert.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/alert.json

It also adds utils. The app needs its setup first: Installation.

Usage

Put AlertTitle and AlertDescription inside; an icon placed first is lined up beside them, and AlertAction sits at the top right. variant="destructive" is for errors. The alert has role="alert", so a screen reader announces it when it appears.

import {
  Alert,
  AlertTitle,
  AlertDescription,
  AlertAction,
} from '@/components/ui/alert'

Examples

Default

A title and a description.

Its preview and code are at the top of the page.

API reference

Alert wraps no headless component of its own: its parts are elements with classes, and their props are the element's.