Tooltip
The props declared for Tooltip, generated from the types @proyecto-viviana/ui ships.
Import
import { Tooltip } from "@proyecto-viviana/ui";Props
| Prop | Type | Default | Description |
|---|---|---|---|
children* | JSX.Element | — | The content of the tooltip. |
placement | 'start' | 'end' | 'top' | 'bottom' | 'left' | 'right' | — | The position of the tooltip relative to the trigger. |
variant | 'default' | 'neutral' | 'info' | — | Deprecated legacy visual variant. Spectrum 2 tooltips use a single neutral treatment. |
styles | StyleString | — | Spectrum-defined generated classes. |
UNSAFE_className | string | — | Additional CSS class name. Use only as a last resort. |
UNSAFE_style | JSX.CSSProperties | — | Additional inline styles. Use only as a last resort. |
class | string | — | Backward-compatible class alias. Prefer UNSAFE_className for S2 parity. |
showArrow | false | true | — | Backward-compatible arrow toggle. Spectrum 2 tooltips render an arrow by default. |
slot | string | false | — | A slot name for the component. HTML `slot` may be `false` to omit. solidaria-components |
dir | 'ltr' | 'rtl' | — | The text direction. solidaria-components |
lang | string | — | The element language. solidaria-components |
id | string | — | The element id. solidaria-components |
aria-describedby | string | — | ID of an element that describes the tooltip. solidaria-components |
aria-details | string | — | ID of an element that provides details for the tooltip. solidaria-components |
aria-label | string | — | Custom aria-label for the tooltip. solidaria-components |
aria-labelledby | string | — | ID of an element that labels the tooltip. solidaria-components |
isDisabled | false | true | — | Whether the tooltip should be disabled. solidaria-components |
defaultOpen | false | true | — | Whether the tooltip is open by default (uncontrolled). solidaria-components |
isOpen | false | true | — | Whether the tooltip is open (controlled). solidaria-components |
containerPadding | number | — | The placement padding between the tooltip and viewport edge. solidaria-components |
offset | number | — | The offset between the tooltip and trigger. solidaria-components |
crossOffset | number | — | The additional offset along the cross axis. solidaria-components |
shouldFlip | false | true | — | Whether the tooltip should flip when there is insufficient room. solidaria-components |
arrowSize | number | — | The arrow size used to keep the arrow overlapping the trigger. solidaria-components |
arrowBoundaryOffset | number | — | The padding between the arrow and tooltip edge. solidaria-components |
Declared in packages/viviana-ui/src/tooltip/index.tsx.
TooltipRender props
| Prop | Type | Default | Description |
|---|---|---|---|
isEntering* | false | true | — | Whether the tooltip is currently entering (for animations). solidaria-components |
isExiting* | false | true | — | Whether the tooltip is currently exiting (for animations). solidaria-components |
placement* | TooltipResolvedPlacement | null | — | The placement of the tooltip relative to the trigger. solidaria-components |
Declared in packages/solidaria-components/src/Tooltip.tsx.
TooltipTrigger props
| Prop | Type | Default | Description |
|---|---|---|---|
children* | JSX.Element | — | The children of the tooltip trigger (trigger element and tooltip). |
placement | 'start' | 'end' | 'top' | 'bottom' | 'left' | 'right' | — | The placement of the tooltip relative to the trigger. solidaria-components |
containerPadding | number | — | The placement padding between the tooltip and viewport edge. solidaria-components |
crossOffset | number | — | The additional offset along the cross axis. solidaria-components |
shouldFlip | false | true | — | Whether the tooltip should flip when there is insufficient room. solidaria-components |
delay | number | — | The delay time in milliseconds for the tooltip to show up. solid-stately |
closeDelay | number | — | The delay time in milliseconds for the tooltip to close. solid-stately |
isDisabled | false | true | — | Whether the tooltip trigger is disabled. solid-stately |
defaultOpen | false | true | — | Whether the overlay is open by default (uncontrolled). solid-stately |
isOpen | false | true | — | Whether the overlay is open (controlled). solid-stately |
onOpenChange | (isOpen: boolean) => void | — | Handler that is called when the overlay's open state changes. solid-stately |
trigger | 'focus' | 'hover' | 'hover' | The trigger mechanism for the tooltip. solidaria |
shouldCloseOnPress | false | true | true | Whether the tooltip should close when the trigger is pressed. solidaria |
tooltipId | string | — | ID of the tooltip element. solidaria |
Declared in packages/viviana-ui/src/tooltip/index.tsx.
Props marked solidaria or solidaria-components come from the headless layer underneath and behave the same in both registers. Components that wrap a DOM element also accept that element's standard attributes, which are left out here on purpose — listing them would bury the props that are actually ours.