UI
Notice
Notice displays a message with a tone-specific icon and up to two action buttons.
Import
import { Notice } from '@tallyui/components';Usage
function ConnectionNotice({ retry }: { retry: () => void }) {
return <Notice tone="warning" title="Connection lost" actions={[{ label: 'Reconnect', onPress: retry }]} />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
tone | 'bad' | 'warning' | 'info' | Required | Selects the band, glyph and announcement priority |
title | string | Required | Message heading |
children | React.ReactNode | — | Content below the title |
actions | readonly [NoticeAction] | readonly [NoticeAction, NoticeAction] | — | Renders one or two ghost buttons in the supplied order |
icon | React.ComponentType<SvgIconProps> | null | Tone's glyph | Pass a component to replace the glyph or null to hide it |
live | boolean | true | Set to false for a plain group with no live announcement |
testID | string | — | Identifies the band and supplies a prefix for the title and action IDs |
className | string | — | Additional classes for the band |
NoticeAction
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | Required | Visible button text |
onPress | () => void | Required | Called when the button is pressed |
testID | string | Parent testID + -action- + zero-based index, if available | Identifies the button in tests |
primary | boolean | — | Styles the label with text-primary when true |
Tones
| Tone | Band classes | Default glyph | Role and priority when live |
|---|---|---|---|
bad | border-bad/45 bg-bad-bg | AlertCircleIcon | alert, assertive |
warning | border-warning/45 bg-warning-bg | AlertTriangleIcon | status, polite |
info | border-border bg-card | InfoCircleIcon | status, polite |
On iOS, a live bad notice announces its title once on mount.