Skip to content

Label

Coloured status label for tables and lists.

Installation

bun add @xerobi/ui
import { Label } from "@xerobi/ui/label"

This component is client-side. In Astro, hydrate it with a client directive.

Examples

Status labels

ActivePendingFailedDraft
import { Label } from "@xerobi/ui/label"

export function LabelStatus() {
  return (
    <div className="flex flex-wrap gap-2">
      <Label color="success">Active</Label>
      <Label color="warning">Pending</Label>
      <Label color="error">Failed</Label>
      <Label>Draft</Label>
    </div>
  )
}

API reference

Label

Status label (a small tinted tag). Built on Badge, with the icon slots the app already uses.

PropTypeDescription
color"default" | "info" | "success" | "warning" | "secondary" | "primary" | "error"
disabledboolean
variant"soft" | "filled" | "outlined" | "inverted"
startIconstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>
endIconstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>

Search documentation

Search pages, components and blocks.