Tally UI
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

PropTypeDefaultDescription
tone'bad' | 'warning' | 'info'RequiredSelects the band, glyph and announcement priority
titlestringRequiredMessage heading
childrenReact.ReactNode—Content below the title
actionsreadonly [NoticeAction] | readonly [NoticeAction, NoticeAction]—Renders one or two ghost buttons in the supplied order
iconReact.ComponentType<SvgIconProps> | nullTone's glyphPass a component to replace the glyph or null to hide it
livebooleantrueSet to false for a plain group with no live announcement
testIDstring—Identifies the band and supplies a prefix for the title and action IDs
classNamestring—Additional classes for the band

NoticeAction

PropTypeDefaultDescription
labelstringRequiredVisible button text
onPress() => voidRequiredCalled when the button is pressed
testIDstringParent testID + -action- + zero-based index, if availableIdentifies the button in tests
primaryboolean—Styles the label with text-primary when true

Tones

ToneBand classesDefault glyphRole and priority when live
badborder-bad/45 bg-bad-bgAlertCircleIconalert, assertive
warningborder-warning/45 bg-warning-bgAlertTriangleIconstatus, polite
infoborder-border bg-cardInfoCircleIconstatus, polite

On iOS, a live bad notice announces its title once on mount.