Status

A small coloured dot that shows a state at a glance.

Feedback Added in v0.41.0 Updated

Default

Online
Away
Offline
Unknown

<div class="flex flex-col gap-2">
	<div class="flex items-center gap-2">
		{ui status, class: 'bg-success' /}
		Online
	</div>
	<div class="flex items-center gap-2">
		{ui status, class: 'bg-warning' /}
		Away
	</div>
	<div class="flex items-center gap-2">
		{ui status, class: 'bg-destructive' /}
		Offline
	</div>
	<div class="flex items-center gap-2">
		{ui status /}
		Unknown
	</div>
</div>

A status is a dot and nothing else, so the word beside it carries the meaning. The dot is hidden from screen readers unless you pass label, which turns it into an image with that name. Leave label out when the text next to it already says the state, as above.

Colour it with a fill such as bg-success, bg-warning, bg-info or bg-destructive. Without one the dot is the muted text colour.

Sizes


<div class="flex items-center gap-4">
	{ui status, class: 'bg-info text-xs', label: 'Small' /}
	{ui status, class: 'bg-info', label: 'Default' /}
	{ui status, class: 'bg-info text-2xl', label: 'Large' /}
</div>

The dot is half the text size, so a text-* class on it resizes it, with any responsive prefix.

On an avatar

AL

<div class="relative inline-block">
	{ui avatar, initials: 'AL' /}
	{ui status,
		label: 'Online',
		class: 'absolute bottom-0 right-0 ring-2 ring-canvas bg-success',
	/}
</div>

Place it with utilities in class. Here the dot sits on the avatar's corner, with a ring in the page colour to cut it from the photo. When the dot stands alone like this, give it a label.