Toggle Tip

A small tip that opens when the user clicks or taps an info button.

Shortcut and parts

ToggleTip: pass the tip as content and wrap the trigger. InfoTip adds a small info button as the trigger.

For full control, use the Popover parts: Popover.Root, Popover.Trigger, Popover.Positioner, and Popover.Content. With Parts builds the same tip both ways.

Usage

Code
import { InfoTip, ToggleTip } from '@leverui/components';
Code
<ToggleTip content="...">{(getProps) => <button {...getProps()} />}</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

Sizes

The toggle tip supports xs, sm, md, and lg size variants. Pass the size prop to both the component and the button to scale it consistently.

Arrow

Set showArrow to display a directional arrow pointing from the popover content to the trigger element.

Close on Escape

By default (true), pressing the Escape key closes the toggle tip. Set to false to keep it open on Escape.

Close on Interact Outside

By default (true), clicking outside the toggle tip closes it. Set to false to allow outside interaction without closing.

With Parts

Both buttons show the same tip. The first uses the ToggleTip shortcut; the second composes the Popover parts for full control.

Guides

Trigger

The trigger is a Solid render function. Spread getProps() on your element to keep the open state, keyboard and focus behavior, and the accessible link to the tip.

Give an icon-only trigger an accessible name that does not change. Use contentProps to give Popover.Content its own name or title.

Portal

Set portalled={false} to render the content in place, or pass portalRef to render it inside another element.

Props

Root

PropDefaultTypeDescription
autoFocustruebooleanFocus the first focusable element on open.
closeOnEscapetruebooleanClose on Escape.
closeOnInteractOutsidetruebooleanClose on click outside.
portalledtruebooleanRender the content in a Portal. Tab order follows the content.
restoreFocustruebooleanReturn focus to the previous element on close.
size'md''xs' | 'sm' | 'md' | 'lg'Tip size.
unstyled—booleanTurn off the default styles.
defaultOpen—booleanStart open, when uncontrolled.
defaultTriggerValue—stringStarting trigger value, when uncontrolled.
finalFocusEl—() => MaybeElementReturns the element to focus on close.
id—stringUnique id.
ids—Element ID mapIds of the popover elements.
immediate—booleanApply present changes right away, not on the next frame.
initialFocusEl—() => HTMLElement | nullReturns the element to focus on open.
lazyMountfalsebooleanRender the content only once the popover first opens.
modalfalsebooleanBlock interaction and scrolling outside, hide the rest from screen readers, and trap focus.
onEscapeKeyDown—(event: KeyboardEvent) => voidCalled on Escape.
onExitComplete—VoidFunctionCalled when the closing animation ends.
onFocusOutside—(event: FocusOutsideEvent) => voidCalled when focus moves outside the popover.
onInteractOutside—(event: InteractOutsideEvent) => voidCalled on interaction outside the popover.
onOpenChange—(details: OpenChangeDetails) => voidCalled when the popover opens or closes.
onPointerDownOutside—(event: PointerDownOutsideEvent) => voidCalled on pointer down outside the popover.
onRequestDismiss—(event: LayerDismissEvent) => voidCalled when this layer closes because a parent layer closed.
onTriggerValueChange—(details: TriggerValueChangeDetails) => voidCalled when the trigger value changes.
open—booleanOpen state, when you control it.
persistentElements—(() => Element | null)[]Elements that keep pointer events and do not close the popover.
positioning—PositioningOptionsPlacement options for the content.
present—booleanPresent state, when you control it.
skipAnimationOnMountfalsebooleanSkip the animation on the first render.
translations—IntlTranslationsTranslated text for assistive technology.
triggerValue—stringTrigger value, when you control it.
unmountOnExitfalsebooleanRemove the content from the DOM on close.

ToggleTip also takes content, showArrow, portalRef, and contentProps. InfoTip adds buttonProps, which go to its icon button.