Dialogs and floating content
Understand open state, focus, dismissal, keyboard navigation, positioning, and announcements across floating interfaces.
Dialog and confirmation behavior
Dialog defaults open=false,
fullScreen=false, andcloseLabel=Close. A closed Dialog renders no DOM.The open dialog uses role=dialog,
aria-modal=true,tabIndex=-1, Escape closing, and Tab focus trapping.Clicking the overlay calls
onClose. An applicationonClickhandler canpreventDefaultto keep it open.Use
labelledByanddescribedByfor stable title and description relationships. Passing title withoutlabelledBydisplays a title but does not invent an ID.ConfirmDialogdefaults title to Confirm action, labels to Confirm and Cancel, and tone to danger. Both actions are application callbacks.
tsximport { Dialog, Text } from "@tavojs/ui";
<Dialog open={open} title="Invite teammate" labelledBy="invite-title" describedBy="invite-help" onClose={close}>
<Text id="invite-help">Choose an account role before sending.</Text>
</Dialog>Popovers and disclosures
Popover defaults open=false and placement=bottom-start. Placement supports bottom-start, bottom-end, top-start, and top-end.
Popover.Contentuses a directive to stay within an eight-pixel viewport margin, update on resize and scroll, and close its native details owner after an outside pointer press.A custom use directive on
Popover.Contentis merged with the positioning directive rather than replacing it.Collapsible is a styled native details element with Root, Trigger, and Content members. open defaults to false.
Tooltip defaults side=top and exposes role=tooltip.
HoverCarduses focusable trigger and tooltip content but does not own application state.
Focus and announcement helpers
FocusTrapdefaults active to true and cycles Tab or Shift+Tab within its descendants. It does not create dialog semantics or restore focus by itself.Spinner defaults size=md, tone=primary, and label=Loading; it exposes status semantics.
Toast defaults tone=info and
closeLabel=Dismiss notification.ToastStackonly positions a group; application state owns its queue and removal.Overlay defaults open=true, scrim=soft, and center=true. It is a visual primitive, not a modal or focus manager.