Skip to main content

Toast

Shared, editable XML components from the toast family.

Usage​

Declare the catalog namespace in your screen and run relo-components build to bundle its dependencies before delivery. Install Components host support before session creation. Use ui:Theme or your compatible theme.

<ui:Theme xmlns:ui="urn:relo:registry:relo">
<ui:Toast />
</ui:Theme>

Dependencies: button, theme.

Exports​

ui:Toast · ui:ToastAction · ui:ToastClose · ui:ToastContent · ui:ToastDescription · ui:ToastProvider · ui:ToastTitle · ui:ToastViewport · ui:Toaster

ui:Toast​

PropDefaultRequired
valuefalseNo
title''No
description''No
duration5000No
pausedfalseNo

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

  • on-change — explicitly emitted output; inspect the definition for payload shape.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="Toast" props="value=false, title='', description='', duration=5000, paused=false">
<Popup bind-value="props.value" mode="notification" side="bottom" bind-label="props.title" on-change="emit change with event" class=" enter:opacity-0 exit:opacity-0 enter:scale-95 exit:scale-95 spring-fast">
<Column class="rc-surface p-4 gap-2">
<Text bind-text="props.title" live="polite" class="font-rc-small font-semibold" />
<Text bind-text="props.description" class="font-rc-small text-rc-muted-foreground" />
<Slot />
<RcNativeTimer bind-value="props.value" bind-duration="props.duration" bind-paused="props.paused" on-change="emit change with event" />
</Column>
</Popup>
</Component>

Read Toast source.

ui:ToastAction​

PropDefaultRequired
label''No
variant'default'No
size'default'No
enabledtrueNo

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Mapped size choices: default, icon, iconLg, iconSm, iconXs, lg, sm, xs.

Mapped variant choices: default, destructive, ghost, link, outline, secondary.

Events​

  • on-press — explicitly emitted output; inspect the definition for payload shape.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="ToastAction" props="label='', variant='default', size='default', enabled=true">
<Pressable bind-label="props.label" bind-enabled="props.enabled" role="button" bind-class="'transition spring-fast ' + ({default: 'rc-button-default', secondary: 'rc-button-secondary', outline: 'rc-button-outline', ghost: 'rc-button-ghost', destructive: 'rc-button-destructive', link: 'rc-button-link'}[props.variant] + ' ' + {default: 'h-8 px-2.5', xs: 'h-6 px-2', sm: 'h-7 px-2.5', lg: 'h-9 px-2.5', icon: 'w-8 h-8 p-2', iconXs: 'w-6 h-6 p-1', iconSm: 'w-7 h-7 p-1.5', iconLg: 'w-9 h-9 p-2'}[props.size])" on-press="emit press with event">
<Row class="h-full flex-1 items-center justify-center gap-2">
<Slot>
<Text bind-text="props.label" class="font-rc-small font-medium" />
</Slot>
</Row>
</Pressable>
</Component>

Read ToastAction source.

ui:ToastClose​

PropDefaultRequired
label''No
variant'default'No
size'default'No
enabledtrueNo

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Mapped size choices: default, icon, iconLg, iconSm, iconXs, lg, sm, xs.

Mapped variant choices: default, destructive, ghost, link, outline, secondary.

Events​

  • on-press — explicitly emitted output; inspect the definition for payload shape.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="ToastClose" props="label='', variant='default', size='default', enabled=true">
<Pressable bind-label="props.label" bind-enabled="props.enabled" role="button" bind-class="'transition spring-fast ' + ({default: 'rc-button-default', secondary: 'rc-button-secondary', outline: 'rc-button-outline', ghost: 'rc-button-ghost', destructive: 'rc-button-destructive', link: 'rc-button-link'}[props.variant] + ' ' + {default: 'h-8 px-2.5', xs: 'h-6 px-2', sm: 'h-7 px-2.5', lg: 'h-9 px-2.5', icon: 'w-8 h-8 p-2', iconXs: 'w-6 h-6 p-1', iconSm: 'w-7 h-7 p-1.5', iconLg: 'w-9 h-9 p-2'}[props.size])" on-press="emit press with event">
<Row class="h-full flex-1 items-center justify-center gap-2">
<Slot>
<Text bind-text="props.label" class="font-rc-small font-medium" />
</Slot>
</Row>
</Pressable>
</Component>

Read ToastClose source.

ui:ToastContent​

PropDefaultRequired
—No declared user props—

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

No directly emitted output events.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="ToastContent">
<Column class="gap-2">
<Slot />
</Column>
</Component>

Read ToastContent source.

ui:ToastDescription​

PropDefaultRequired
text''No

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

No directly emitted output events.

Slots​

No content outlets.

Definition and forwarded payloads
<Component name="ToastDescription" props="text=''">
<Text bind-text="props.text" class="font-rc-small text-rc-muted-foreground" />
</Component>

Read ToastDescription source.

ui:ToastProvider​

PropDefaultRequired
—No declared user props—

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

No directly emitted output events.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="ToastProvider">
<Column class="gap-2">
<Slot />
</Column>
</Component>

Read ToastProvider source.

ui:ToastTitle​

PropDefaultRequired
text''No

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

No directly emitted output events.

Slots​

No content outlets.

Definition and forwarded payloads
<Component name="ToastTitle" props="text=''">
<Text bind-text="props.text" class="font-rc-small font-medium" />
</Component>

Read ToastTitle source.

ui:ToastViewport​

PropDefaultRequired
—No declared user props—

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

No directly emitted output events.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="ToastViewport">
<Column class="gap-2">
<Slot />
</Column>
</Component>

Read ToastViewport source.

ui:Toaster​

PropDefaultRequired
value[]No
pausedfalseNo
label'Notifications'No

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

  • on-change — explicitly emitted output; inspect the definition for payload shape.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="Toaster" props="value=[], paused=false, label='Notifications'" xmlns:ui="urn:relo:registry:relo">
<Popup state="{pendingIds:[],revision:0}" mode="notification" side="bottom" bind-value="props.value != []" bind-label="props.label" bind-dismissible="false" class=" enter:opacity-0 exit:opacity-0 enter:scale-95 exit:scale-95 spring-fast">
<Column class="gap-2">
<For each="toast" in="props.value" key="toast.id">
<Column show="toast.active" class="rc-surface p-4 gap-2">
<Text bind-text="toast.title" live="polite" class="font-rc-small font-medium" />
<Text bind-text="toast.description" class="font-rc-small text-rc-muted-foreground" />
<ui:Button label="Dismiss" variant="ghost" on-press="set pendingIds to pendingIds + [toast.id]; set revision to revision + 1; let version be revision; call uiToast.remove with {value:props.value,ids:pendingIds} into next; if revision == version then set pendingIds to []; emit change with {value:next} end" />
<RcNativeTimer bind-value="toast.active" bind-duration="toast.duration" bind-paused="props.paused" on-change="set pendingIds to pendingIds + [toast.id]; set revision to revision + 1; let version be revision; call uiToast.remove with {value:props.value,ids:pendingIds} into next; if revision == version then set pendingIds to []; emit change with {value:next} end" />
</Column>
</For>
<Slot />
</Column>
</Popup>
</Component>

Read Toaster source.

Composition and accessibility​

Use explicit value/change ownership; events do not bubble automatically. A component forwards only outputs declared by its own emits. Slots retain caller scope. Supply meaningful labels for interactive controls, preserve focus and touch targets, and test reduced motion on each platform.

Component customization · Definitions and slots · Components index