FloatingIndicator
Display a floating indicator over a group of elements
Source
LLM docs
Docs
PackageIcon
Usage
FloatingIndicator is designed to highlight the active element in a group.
It can be used to create custom segmented controls, tabs and other similar components.
FloatingIndicator renders an element over the target element. To calculate the position, it is
required to pass a parent element. The parent element must have position: relative CSS property –
this is essential for correct positioning. The component returns null and renders nothing if either
target or parent is not provided.
By default, FloatingIndicator does not have any visible styles. You can use the className prop
or Styles API to apply styles. Note that the indicator's transform, width,
and height styles are set directly via JavaScript to enable smooth position transitions – these
cannot be overridden via the Styles API.
Multiple rows
FloatingIndicator can be used to highlight the active element in a group with multiple rows: