Tessina UI
Tessina UI
GitHubIntroduction
InstallationUsageTheming
Components
ButtonIconButtonLinkSpinnerBadgeAvatarStatusChipShortcutSkeletonSurfaceProgressMeterRating
LabelFieldFieldsetCheckboxRadioSwitchSliderSelectComboboxSearchTextareaNumberFieldDate PickerTime PickerOTP InputFile UploadCalendar
AlertBannerToastTooltip
TabsAccordionCollapsibleBreadcrumbPaginationStepperSegmentedControlButtonGroupToggleButtonToggleGroupToolbarNavigation MenuMenubarBottom NavSidebar
Split ButtonFABDropdown MenuContextMenuCommandPopoverHoverCard
ContainerStackFlexGridAspectRatioSpacerCardCarouselDividerScroll Area
Table
ChatBubblePromptInputCodeBlock
ModalAlertDialogDrawerAction SheetTop Header MobileTop Header DesktopEmptyStateForm
Contributing
ComponentsFeedback Blocks

Toast

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

Showcase

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)

Banner

Promotional / informational surface for marketing, onboarding, upsell, and announcements. Three layouts (inline, centered, landscape with edge-to-edge image), four variants, six intents, prefix/suffix slots, primary + secondary actions, inline arrow link, optional footer row, dismissible, LTR/RTL.

Tooltip

Rich tooltip card for product tours, feature walkthroughs, and contextual help. Supports title, image, subtitle, description, keyboard shortcuts, step counter, navigation buttons, a close button, 5 intent colors, 6 rounded variants, and all 12 arrow positions.

On this page

ShowcaseUsageSetupFiring a toastAPIToastToastActionToasteruseToastToastDataPosition values