tuil
ReferenceComponentsDialogs, toasts, and overlays

Dialogs, toasts, and overlays

Layer focus-trapped dialogs, contextual help, transient notices, and searchable command execution over an application.

View rawEdit

Overview

Layer focus-trapped dialogs, contextual help, transient notices, and searchable command execution over an application.

Installation

npx @mwillbanks/tuil add dialog confirm-dialog tooltip toast command-palette drawer popover skeleton error-boundary

The CLI writes source-owned components beneath the destination configured in tuil.config.ts; the default import below assumes src/components/tuil.

Loading executable example…

Components and subcomponents

APISignatureDescription
Dialogconstant DialogPublic constant Dialog.
Dialog.Triggersubcomponent Dialog.TriggerPublic subcomponent Dialog.Trigger.
Dialog.Contentsubcomponent Dialog.ContentPublic subcomponent Dialog.Content.
Dialog.Titlesubcomponent Dialog.TitlePublic subcomponent Dialog.Title.
Dialog.Descriptionsubcomponent Dialog.DescriptionPublic subcomponent Dialog.Description.
Dialog.Confirmsubcomponent Dialog.ConfirmPublic subcomponent Dialog.Confirm.
Dialog.Cancelsubcomponent Dialog.CancelPublic subcomponent Dialog.Cancel.
ConfirmDialogfunction ConfirmDialogPublic function ConfirmDialog.
Tooltipfunction TooltipPublic function Tooltip.
ToastProviderfunction ToastProviderPublic function ToastProvider.
useToastfunction useToastPublic function useToast.
Toastfunction ToastPublic function Toast.
ToastViewportfunction ToastViewportPublic function ToastViewport.
CommandPalettefunction CommandPalettePublic function CommandPalette.
Drawerconstant DrawerPublic constant Drawer.
Popoverconstant PopoverPublic constant Popover.
Skeletonfunction SkeletonPublic function Skeleton.
ErrorBoundaryclass ErrorBoundaryPublic class ErrorBoundary.

Interaction

The top overlay receives input before application hotkeys. Escape closes dismissible overlays and focus returns to the prior node.

API and events

Open state and selections flow through onOpenChange, onPress, command callbacks, and the toast API.

Every interactive component publishes semantic roles, labels, state, and focus identity through the renderer's SemanticRegistry. Callback failures flow to the owning application's error boundary.

Documentation flow diagram. props and runtime state; semantic registration; focus and input routing; callback or state update; rerender; S0 leads to S1; S1 leads to S2; S2 leads to S3
Documentation flow diagram. props and runtime state; semantic registration; focus and input routing; callback or state update; rerender; S0 leads to S1; S1 leads to S2; S2 leads to S3

Example

import type { ComponentProps } from "react";
import { Dialog } from "@/components/tuil/feedback/overlays";

export function Example(props: ComponentProps<typeof Dialog>) {
  return <Dialog {...props} />;
}

Registry-installed components are source-owned: customize the generated file in your application, and use the package reference for the shared runtime contracts.

On this page