Components · Feedback
Alert
Inline contextual message with optional title, icon, and dismiss action.
import { Alert } from '@nexub/react';Usage
Communicating system status, errors, or success after an action
Showing inline validation feedback inside a form
Warning the user about a potentially risky operation
Providing contextual information relevant to the current page
Transient messages — use Toast for ephemeral notifications
Blocking the user for a required decision — use AlertDialog
Marketing or promotional messaging
Replacing empty states — use EmptyState instead
Playground
Props
<Alert title="Heads up" tone="info">Your trial expires in 3 days.</Alert>Examples
Default
Tones
Dismissible
States
- Heads upYour trial expires in 3 days.
default - Heads upYour trial expires in 3 days.
tone="neutral" - Heads upYour trial expires in 3 days.
tone="info" - Heads upYour trial expires in 3 days.
tone="success" - Heads upYour trial expires in 3 days.
tone="warning" - Heads upYour trial expires in 3 days.
tone="danger" - Heads upYour trial expires in 3 days.
tone="leap" - Heads upYour trial expires in 3 days.
tone="bookub" - Heads upYour trial expires in 3 days.
tone="payub"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'leap' | 'bookub' | 'payub' | 'founderub' | 'neutral' | Semantic colour tone of the alert. |
| title | React.ReactNode | — | Bold title rendered at the top of the alert. 11.5: any content (a link, a name in bold); was a string. |
| icon | React.ReactNode | — | Custom icon rendered to the left of the content. |
| action | React.ReactNode | — | Action element (e.g. a button) rendered beside the content. |
| onClose | (() => void) | — | When provided, renders a close button that calls this handler. |
Design tokens
Alert reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Alert below it, and leave the roles other components share alone. See the three token tiers.
Colours follow the variant, so only the radius is a token.
| Token | Aliases | Notes |
|---|---|---|
| --alert-radius | --shape-container | — |
/* One area of your app */
.checkout {
--alert-radius: var(--shape-field);
}On iOS & Android: Banner
import { Banner } from '@nexub/react-native';
<Banner tone="info">Transfers over S$5,000 take one working day.</Banner>Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Name | Alert. | Banner. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
Banner props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | — |
| children | React.ReactNode | — | — |
| tone | ToneValue | 'info' | — |
| action | React.ReactNode | — | One action, e.g. <Button variant="text">Review</Button>. |
| onDismiss | () => void | — | — |
| haptic | boolean | false | Play the tone's haptic when the banner appears: success, warning, or the error haptic for danger (12.3). Off when the user turned haptics off in NexubNativeProvider, or where the platform has none. |