Skip to Content
Documentation
Getting startedComponentsChartsTheming
Get Pro
Overview
Concepts

Toggle Tip

Looks like a tooltip, but works like a popover.

Anatomy

import { InfoTip } from '#components/ui/info-tip'
import { ToggleTip } from '#components/ui/toggle-tip'
<ToggleTip content="...">
  <button />
</ToggleTip>

Examples

Info Tip

Use the InfoTip component to display an info tip. This component renders an icon button with an info icon by default.

Useful for landing pages to display additional information about a feature.

File size: 1.45 kB

Props

Root

PropDefaultType
autoFocus true
boolean

Whether to automatically set focus on the first focusable content within the popover when opened.

closeOnEscape true
boolean

Whether to close the popover when the escape key is pressed.

closeOnInteractOutside true
boolean

Whether to close the popover when the user clicks outside of the popover.

hideMode ''display-none''
HideMode

How to hide content when mounted but not present. - `'display-none'`: HTML `hidden` attribute. Effects stay alive. - `'activity'`: React 19 `<Activity mode="hidden">`. Effects pause. Requires React 19+.

lazyMount false
boolean

Whether to enable lazy mounting

modal false
boolean

Whether the popover should be modal. When set to `true`: - interaction with outside elements will be disabled - only popover content will be visible to screen readers - scrolling is blocked - focus is trapped within the popover

portalled true
boolean

Whether the popover is portalled. This will proxy the tabbing behavior regardless of the DOM position of the popover content.

restoreFocus true
boolean

Whether to restore focus to the element that had focus before the popover was opened.

skipAnimationOnMount false
boolean

Whether to allow the initial presence animation.

unmountOnExit false
boolean

Whether to unmount on exit.

colorPalette 'gray'
'gray' | 'zinc' | 'neutral' | 'stone' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'presence' | 'status' | 'sidebar' | 'sidebar.accent' | 'accent' | 'slate'

The color palette of the component

size 'md'
'xs' | 'sm' | 'md' | 'lg'

The size of the component

defaultOpen
boolean

The initial open state of the popover when rendered. Use when you don't need to control the open state of the popover.

defaultTriggerValue
string

The initial trigger value when rendered. Use when you don't need to control the trigger value.

finalFocusEl
() => MaybeElement

Element to receive focus when the popover is closed.

id
string

The unique identifier of the machine.

ids
Partial<{ anchor: string trigger: string | ((value?: string | undefined) => string) content: string title: string description: string closeTrigger: string positioner: string arrow: string }>

The ids of the elements in the popover. Useful for composition.

immediate
boolean

Whether to synchronize the present change immediately or defer it to the next frame

initialFocusEl
() => HTMLElement | null

The element to focus on when the popover is opened.

onEscapeKeyDown
(event: KeyboardEvent) => void

Function called when the escape key is pressed

onExitComplete
VoidFunction

Function called when the animation ends in the closed state

onFocusOutside
(event: FocusOutsideEvent) => void

Function called when the focus is moved outside the component

onInteractOutside
(event: InteractOutsideEvent) => void

Function called when an interaction happens outside the component

onOpenChange
(details: OpenChangeDetails) => void

Function invoked when the popover opens or closes

onPointerDownOutside
(event: PointerDownOutsideEvent) => void

Function called when the pointer is pressed down outside the component

onRequestDismiss
(event: LayerDismissEvent) => void

Function called when this layer is closed due to a parent layer being closed

onTriggerValueChange
(details: TriggerValueChangeDetails) => void

Function called when the trigger value changes.

open
boolean

The controlled open state of the popover

persistentElements
(() => Element | null)[]

Returns the persistent elements that: - should not have pointer-events disabled - should not trigger the dismiss event

positioning
PositioningOptions

The user provided options used to position the popover content

present
boolean

Whether the node is present (controlled by the user)

translations
IntlTranslations

Specifies the localized strings that identifies the accessibility elements and their states

triggerValue
string

The controlled trigger value

as
React.ElementType

The underlying element to render.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
unstyled
boolean

Whether to remove the component's style.

Previous

Toast

Next

Tooltip