Base UITransitions
Tooltip
No special state names here, which is the one place Base UI is simpler than Radix.
Every value the manifest allows on this host, single presets and the pairs that compose. The first is what this component ships with. Both stages are the same component, so anything that changes between them is the attribute.
withoutno attribute
with easefuldata-motion="scale-fade"
host writes
data-ending-style, data-side
easeful matches
[data-motion~="scale-fade"][data-ending-style]
what runs
transition: opacity, scale 150ms
you write
<Tooltip.Popup data-motion="scale-fade" />
Where the attribute goes
The parts this demo composes, and the value each one carries. Everything inside an animated part is that part's content, so the tree stops there.
Tooltip.ProviderTooltip.RootTooltip.TriggerTooltip.PortalTooltip.PositionerTooltip.Popupdata-motion="scale-fade"
Source
"use client"
import { Tooltip } from "@base-ui/react/tooltip"
import type { DemoProps } from "@/components/demos/props"
export function BaseUiTooltip({ motion }: DemoProps) {
return (
<Tooltip.Provider delay={120}>
<Tooltip.Root>
<Tooltip.Trigger className="btn">Hover me</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Positioner sideOffset={10} collisionPadding={16}>
<Tooltip.Popup className="panel" data-motion={motion}>
<p className="panel__body">No special state names here, unlike Radix.</p>
</Tooltip.Popup>
</Tooltip.Positioner>
</Tooltip.Portal>
</Tooltip.Root>
</Tooltip.Provider>
)
}motion prop is the only difference between them.