Build faster with Premium Chakra UI Components 💎

Learn more
Skip to Content
DocsPlaygroundGuidesBlog
Sponsor

Toggle Tip

Looks like a tooltip, but works like a popover.

Setup

If you don't already have the snippet, run the following command to add the toggle-tip snippet

npx @chakra-ui/cli snippet add toggle-tip

The snippet includes a closed component composition for the Popover component.

Usage

import { InfoTip, 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.

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.

unmountOnExit false
boolean

Whether to unmount on exit.

colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink' | 'accent'

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 it is first rendered. Use when you do not need to control its open state.

id
string

The unique identifier of the machine.

ids
Partial<{ anchor: string trigger: 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
() => void

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

open
boolean

Whether the popover is open

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)

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