Toast
Provider-owned imperative transient-message API with placement, duration, stacking, safe-area positioning, and programmatic dismissal.
Toast is an imperative ARCUI feedback API rather than a visual component import. The mounted ARCUI provider owns lifecycle, stacking, placement, safe area, motion, and accessibility announcement behavior.
Usage
import { showToast } from "react-native-arc-ui";
showToast({
message: "Changes saved",
});ARCUI must be mounted before showToast() / hideToast() are called. Calling the API without an active provider throws clearly.
Returned ID and early dismissal
showToast returns a stable TToastId:
import { hideToast, showToast } from "react-native-arc-ui";
const id = showToast({ message: "Uploading…" });
hideToast(id);Unknown or already-closing IDs are intentionally a no-op. hideToast requests the normal exit lifecycle rather than tearing the item out mid-transition.
Message invariant
message is both visible content and the semantic announcement. It must be a non-empty string containing non-whitespace content.
showToast({ message: "Saved" }); // validEmpty/whitespace-only messages are fundamental semantic misuse and throw instead of creating inaccessible feedback.
Placement
showToast({
message: "Connection restored",
placement: "top",
});Supported placements:
top | bottomWhen omitted, ARCUI uses tokens.toastAnimations.placement. Malformed dynamic placement values report in development and safely fall back to bottom.
Top and bottom maintain independent visible stacks.

Duration
showToast({
message: "Saved",
duration: 1800,
});Duration is milliseconds:
undefined -> tokens.toastAnimations.displayDuration
0 -> request immediate dismissal
>= 0 -> explicit display lifetimeInvalid runtime values report in development and fall back to the configured display duration.
Icon content
showToast({
message: "Saved",
tone: "success",
icon: <Icon type="check" colors={{ icon: "rgba(255,255,255,1)" }} />,
});icon is decorative consumer content. ARCUI hides the icon slot from the accessibility tree because the message owns Toast semantics.
Semantic tones and colors
tone supports neutral (default), info, success, warning, and danger. To override individual visual slots, use colors.background, colors.text, or colors.border.stacked.
showToast({
message: "Please check your connection",
tone: "warning",
colors: {
border: { stacked: "rgba(140,105,0,0.62)" },
},
});Omitted slots continue using their matching tone/state tokens. A { light, dark } pair opts the slot into ARCUI's animated theme transition.

Stacking and capacity
The provider measures mounted Toast heights and calculates stack offsets so newest feedback is anchored closest to the configured screen edge.
Relevant sizing behavior includes:
maxVisibleItemsPerPlacement
stackOverlap
stackGap
stackScaleStep
stackMinScaleCapacity is enforced per placement. When a stack exceeds its configured visible capacity, the oldest entries for that placement are evicted.
Safe area
Top/bottom stacks use provider system insets resolved through tokens.safeArea.toast. Toast therefore follows the same ARCUI safe-area source as the rest of the library rather than introducing a direct safe-area dependency.
Multiple ARCUI providers
ARCUI is normally mounted once. If multiple providers temporarily exist during development/tests/navigation transitions, the most recently mounted provider owns the imperative Toast API. This keeps global calls deterministic.
Do not intentionally build application architecture around multiple competing Toast roots.
Testing
showToast({
message: "Saved",
testID: "save-toast",
});Stable IDs:
save-toast
save-toast-messageThe icon is consumer-owned and does not receive an ARCUI-generated test suffix.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| message | string | required | Visible and announced Toast message. Must contain at least one non-whitespace character. Empty or whitespace-only messages are semantic API misuse and throw. |
| tone? | TToastTone | "neutral" | Semantic Toast palette. |
| colors? | Readonly<IToastColors> | — | Per-instance ARCUI-owned Toast color overrides. |
| icon? | ReactNode | — | Optional decorative content rendered before the message. Toast accessibility semantics are owned by message. Decorative icon content is intentionally hidden from the accessibility tree. |
| duration? | number | — | Time in milliseconds before the Toast begins its normal exit lifecycle. Must be a finite non-negative number. 0 requests immediate dismissal. When omitted, ARCUI uses tokens.toastAnimations.displayDuration. Invalid runtime values report in development and safely fall back to the configured display duration. |
| placement? | TToastPlacement | — | Screen edge used by this Toast. When omitted, ARCUI uses tokens.toastAnimations.placement. Malformed runtime JavaScript values report in development and safely degrade to the bottom placement. |
| testID? | string | — | Deterministic native root identifier for automation. The message descendant uses `${testID}-message`. |
Per-instance color slots: IToastColors
| Prop | Type | Default | Description |
|---|---|---|---|
| background? | TThemeColor | — | — |
| text? | TThemeColor | — | — |
| border? | Readonly<{
stacked?: TThemeColor;
}> | — | — |
Generated from the ARCUI 2.0.0 TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
Generated from the ARCUI 2.0.0 TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
Imperative functions:
showToast(input: TToastInput): TToastId
hideToast(id: TToastId): voidMotion
Toast separates item lifecycle motion from stack reflow motion:
- enter/exit opacity + directional translation share one lifecycle progress;
- sibling stack position/scale/border transitions use independent SharedValues;
- active animations are cancelled before retargeting;
- Reduced Motion snaps stack/lifecycle visuals to their target state.
That separation lets a Toast reverse/close while neighboring items reflow without coupling unrelated motion dimensions.
Performance
Timers are provider lifecycle work, not frame-by-frame React animation. React state owns the Toast entries/measured heights; Reanimated owns continuous enter/exit and stack interpolation.
Height updates are ignored when unchanged within a small tolerance to avoid unnecessary provider state churn.
Accessibility
message is the single semantic Toast payload. On Android the item uses live-region behavior; on iOS ARCUI explicitly queues the message announcement when it becomes semantically visible.
Decorative stack layers and icon content are hidden from accessibility to avoid duplicate announcements.
Theming
Relevant token areas include:
colors.*.toast
sizings.toast
radius.toast
typography.toast
toastAnimations
safeArea.toast
zIndex.toast
animationsTry it live
Explore Toast interactively in Expo Snack.
Related components
Modal
Controlled ARCUI bottom-sheet modal with Host rehosting, safe-area geometry, stacking, swipe dismissal, UI-thread motion, and accessibility isolation.
Dialog
Provider-owned imperative ARCUI dialog API with explicit actions, async loading, controlled dismissal, replacement lifecycle, and tokenized enter/exit motion.

