Alert
A static callout — info / warning / destructive. Mirrors shadcn Alert. No interactivity, no dismiss button by default.
Purpose
A static callout — info / warning / destructive. Mirrors shadcn Alert. No interactivity, no dismiss button by default.
Island model
island: false. Pure presentational; ships zero client JS.
Peer dependencies
class-variance-authority@^0.7
Public API
export type AlertVariant = "default" | "destructive"
export function Alert(props: {
variant?: AlertVariant
className?: string
children?: React.ReactNode
}): JSX.Element
export function AlertTitle(props: { className?: string; children?: React.ReactNode }): JSX.Element
export function AlertDescription(props: { className?: string; children?: React.ReactNode }): JSX.Element
export const island = false
Patties adjustments
- Drops
forwardRef. - Uses
role="alert"on the root. - A
dismissiblevariant exists upstream; in Patties it is provided by 03-alert-dialog instead, since "dismissible" implies state.
Acceptance criteria
- Renders
role="alert"with correct ARIA semantics under SSR. variant="destructive"applies destructive tokens (--destructive,--destructive-foreground).- Bundle audit: page using only
Alertships zero JS.