Tessina UI
ConfiguratorGitHubIntroduction
InstallationUsageTheming
ComponentsAccordionAction SheetAlertAlertDialogArea ChartAspectRatioAvatarBadgeBannerBar ChartBottom NavBreadcrumbButtonButtonGroupCalendarCardCarouselChartChatBubbleCheckboxChipCodeBlockCollapsibleColor PickerComboboxCommandContainerContextMenuDate PickerDividerDrawerDropdown MenuEmptyStateFABFieldFieldsetFile UploadFile Upload 2FlexFormGridHoverCardIconButtonLabelLine ChartLinkMenubarMeterModalNavigation MenuNumberFieldOTP InputPaginationPie ChartPopoverProgressPromptInputRadar ChartRadial ChartRadioRatingScroll AreaSearchSegmentedControlSelectShortcutSidebarSkeletonSliderSpacerSpinnerSplit ButtonStackStatusStepperSurfaceSwitchTableTabsTextareaTime PickerToastToggleButtonToggleGroupToolbarTooltipTop Header DesktopTop Header Mobile
Contributing
Components

Toast

Transient floating notifications for short feedback messages, with optional actions and auto-dismiss.

Examples

Default

A basic toast with a title, description, and dismiss button.

Intents

Semantic colors and icons for success, error, warning, and info.

Sizes

Two sizes — compact sm and standard md.

With action

Pair a toast with an inline CTA button for follow-up actions.

Title only

A minimal toast that omits the description for short, single-line feedback.

Loading

Toast-shaped skeleton placeholders for queued or loading notifications.

Usage

import { Toast, ToastProvider, Toaster, useToast } from "@tessinaui/ui/toast";

Setup

Wrap your app (or layout) with ToastProvider and place Toaster where you want notifications to appear.

export default function RootLayout({ children }) {
  return (
    <ToastProvider>
      {children}
      <Toaster position="bottom-right" />
    </ToastProvider>
  );
}

Firing a toast

function MyComponent() {
  const { toast } = useToast();

  return (
    <button onClick={() =>
      toast({
        title: "Changes saved",
        description: "Your profile has been updated successfully.",
        intent: "success",
        action: { label: "Undo", onClick: handleUndo },
      })
    }>
      Save
    </button>
  );
}

API

Toast

PropTypeDefaultDescription
titleReactNode—Bold heading line
descriptionReactNode—Supporting body text
intent"none" | "error" | "warning" | "success" | "info""none"Semantic color and default icon
size"sm" | "md""md"Compact or standard size
iconReactNode—Overrides the default intent icon
showIconbooleantrueShow/hide the leading icon
actionToastAction—Inline CTA button
onClose() => void—Renders a dismiss (×) button
dir"ltr" | "rtl""ltr"Text direction
classNamestring—Extra class names

ToastAction

PropTypeDefaultDescription
labelstring—Button label
onClick() => void—Click handler
variantButtonVariant"primary"Button style override

Toaster

PropTypeDefaultDescription
positionToastPosition"bottom-right"Screen corner for the stack
maxVisiblenumber5Max simultaneously shown
defaultDurationnumber5000Auto-dismiss ms (0 = persistent)
defaultSize"sm" | "md""md"Fallback size
defaultDir"ltr" | "rtl""ltr"Fallback direction

useToast

const { toast, dismiss, dismissAll, toasts } = useToast();
ReturnTypeDescription
toast(data: ToastData) => stringAdds a toast; returns its id
dismiss(id: string) => voidRemoves a toast by id
dismissAll() => voidClears all toasts
toastsToastData[]Current toast stack

ToastData

PropTypeDefaultDescription
titleReactNode—Heading (required)
descriptionReactNode—Supporting text
intentToastIntent"none"Semantic color
sizeToastSizeToaster defaultOverride size
dir"ltr" | "rtl"Toaster defaultOverride direction
actionToastAction—Inline CTA
durationnumber5000ms before auto-dismiss; 0 = persistent
iconReactNode—Custom leading icon
showIconbooleantrueShow/hide icon

Position values

ValueDescription
"top-left"Top-left corner
"top-center"Top-center
"top-right"Top-right corner
"bottom-left"Bottom-left corner
"bottom-center"Bottom-center
"bottom-right"Bottom-right corner (default)

Time Picker

Three time-picker variants — a drum-roll wheel, a typed HH:MM input field, and a button-triggered popover. Supports 12h/24h formats, seconds, configurable minute steps, all intent colours, RTL, and keyboard navigation.

ToggleButton

A button that toggles between on and off states, with the same variant, intent, size, and rounded system as Button. Shows a persistent pressed visual when active.

On this page

ExamplesDefaultIntentsSizesWith actionTitle onlyLoadingUsageSetupFiring a toastAPIToastToastActionToasteruseToastToastDataPosition values