IndicatorA small dot indicator with small information that can be positioned on top of other components.
Install the component from your command line.
Import and usage.
The
When no label is provided, the Indicator will show as a dot:
The Indicator component includes several accessibility features:
Content
New
Content with dot
npm install @raystack/apsara
import { Indicator } from '@raystack/apsara/v1' <Indicator variant="accent" label="New"> <div>Content</div> </Indicator>
Indicator
component accepts the following props:
variant
: Visual style variant ("accent"
|"warning"
|"danger"
|"success"
|"neutral"
, default: "accent")label
: Optional text label to display (if omitted, shows a dot)aria-label
: Optional custom description for screen readerschildren
: The content to show the indicator onclassName
: Additional CSS class names- All other HTMLDivElement attributes from React
loading...
loading...
- Uses
role="status"
to indicate its purpose to screen readers - Provides appropriate
aria-label
based on the content:- Uses custom
ariaLabel
prop if provided - Falls back to the label text if available
- Uses a default "indicator" if neither is provided
- Uses custom
- Hides decorative dot from screen readers when no label is present
loading...