Skip to main content

Status Indicator

This component is used to render current status of the parent component.

Example

Live Editor
Result
Loading...

Variants

Custom Labels

We can use customLabels props which needs to match the StatusIndicatorLabelTypes to show custom lables, when no custom labels are passed, default props are used.

Live Editor
Result
Loading...

Disabled Tooltip

isTooltipDisabled is an optional prop that makes the tooltip disabled if the user wants to show only the provided label. The default value of the prop is false.

defaultLabels: {
progress: 'Saving…',
positive: 'Saved!',
warning: 'Not Saved!',
negative: 'Disconnected!'
}
Live Editor
Result
Loading...

Kind

We have three kinds of status, i.e., progress, positive, warning and negative. StatusIndicator requires 'kind' to render component.

Live Editor
Result
Loading...
Live Editor
Result
Loading...
Live Editor
Result
Loading...
Live Editor
Result
Loading...

Label

StatusIndicator has a withLabel prop for showing label, here you can see defautlLabels for indicatorType. If the StatusIndicator is not using withLabel, make sure you are passing aria-label to the component.

defaultLabels: {
progress: 'Saving…',
positive: 'Saved!',
warning: 'Not Saved!',
negative: 'Disconnected!'
}
Live Editor
Result
Loading...

Working example with component and labels.

To hide the tooltip leave the label variant empty!

Live Editor
Result
Loading...

Props

NameTypeDefault
kind *
The prop for kind which is required to enable the indicator and shows the status based on its given type without label.
"negative" | "positive" | "warning" | "progress"
withLabel
This prop enables the display of a label next the status indicator. If no custom label is passed, it uses the default labels.
boolean
customLabels
The prop for status indicator with custom labels with StatusIndicatorLabelTypes, if not passed uses default props that can be exported from StatusIndicator component.
StatusIndicatorLabelTypes
"{ positive: 'Saved!', warning: 'Not Saved!', negative: 'Disconnected!', progress: 'Saving…' }"
isTooltipDisabled
The prop turns off the tooltip in case the user wants to show a label without a tooltip.
boolean
false
aria-label
Provide at least one label(visual or non-visual) property for better accessibility. Check Accessibility page for more info: Link
string
data-{foo}
Data attributes can be used by testing libraries to retrieve components or assert their existence
string
* - the prop is required.