Skip to content
Twentyfirst UIPro

Tooltip

Overlays · Button, Combobox, Icon, Popover, Tooltip

View as Markdown

Tooltip names an icon-only control on hover or focus; Popover holds a small interactive panel anchored to a trigger.

Tooltip props: label, shortcut, side ("top" | "bottom" | "left" | "right"), one child element. Popover props: trigger (element, or ({open, toggle}) => element), open/onOpenChange (optional control), align ("start" | "end"), side ("top"), width, flush (no padding, for Menus), block, children or ({close}) => children.

  • Tooltips only add a name or a shortcut. Anything you must read or click goes in a Popover.
  • Tooltips appear after 350 ms on hover, immediately on keyboard focus, and close on Esc.
  • Popovers close on outside click and Esc. Use a Modal when the task needs more than a few fields.
Copy share link⌘L

Props

Button

PropTypeNotes
variant?"primary" | "secondary" | "soft" | "ghost" | "danger" | "danger-solid"
size?"md" | "sm"
icon?IconName
iconRight?IconName
disabled?boolean
type?"button" | "submit" | "reset"
onClick?(e: MouseEvent<HTMLButtonElement>) => void
children?ReactNode
asChild?booleanRender the single child element (a link, a router Link) with the button's look instead of a <button>.
id?string
name?stringForm field name and value, sent with the form when this button submits it.
value?string
form?stringThe id of the form this button belongs to, when it sits outside it.
title?string
tabIndex?number
autoFocus?boolean
aria-label?string
aria-labelledby?string
aria-describedby?string
aria-expanded?boolean | "true" | "false"For disclosure and menu triggers: whether what the button controls is open.
aria-controls?string
aria-haspopup?boolean | "true" | "false" | "menu" | "listbox" | "tree" | "grid" | "dialog"
aria-pressed?boolean | "true" | "false" | "mixed"For toggle buttons.
aria-current?boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time"
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Combobox

PropTypeNotes
label?string
options(string | Option)[]Required
value?string | string[] | null
defaultValue?string | string[]
onChange?(v: string | string[] | null) => void
multiple?boolean
creatable?boolean
placeholder?string
hint?string
error?string
required?boolean
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Icon

PropTypeNotes
nameIconNameRequired
size?number
label?string
className?string
style?CSSPropertiesInline style on the root element.

Popover

PropTypeNotes
triggerReactNode | ((s: { open: boolean; toggle: () => void }) => ReactNode)Required
open?boolean
onOpenChange?(o: boolean) => void
align?"start" | "end"
side?"top" | "bottom"
width?number
flush?boolean
block?boolean
role?string
children?ReactNode | ((s: { close: () => void }) => ReactNode)
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Tooltip

PropTypeNotes
labelReactNodeRequired
shortcut?string
side?"top" | "bottom" | "left" | "right"
defaultOpen?booleanStarts open (for demos and onboarding hints); it still closes on blur and Escape.
childrenReactNodeRequired
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.