Search the documentation

Type to search page titles, component names and descriptions.

    Data Display

    Badge, Tag and Status

    Short labels that carry a state or a category.

    import { Badge, CountBadge, Tag, Status } from 'faifo-design'

    Badge states a status with a tone. Tag labels a category the reader may have chosen. CountBadge shows a number beside a label, and Status is the record-level state with its indicator.

    #When to use

    • A tone carries meaning (positive, warning, danger, info); never rely on colour alone, the label says the state.
    • Use Tag for classification, Badge for state.
    • Announce a changing count only when the reader needs to hear it (announce).

    #Examples

    Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.

    #Badge and tag

    Tones carry meaning; badges fit their labels inside Inline and stretching Stack layouts.

    NeutralNo stock trackingSynchronizedReadyNeeds reviewFailedHà Nội12 pending items
    Observation onlyThe badge stays compact above its longer explanation.A longer status remains readable and wraps within a narrow container
    Show codeHide code
    import { Badge, CountBadge, Inline, Stack, Tag, Text } from 'faifo-design'
    
    export const Example = () => (
      <Inline
        items={[
          <Badge label="Neutral" />,
          <Text tone="muted">No stock tracking</Text>,
          <Badge label="Synchronized" tone="info" />,
          <Badge label="Ready" tone="positive" />,
          <Badge label="Needs review" tone="warning" />,
          <Badge label="Failed" tone="danger" />,
          <Tag label="Hà Nội" removeHref="#status" removeLabel="Remove Hà Nội filter" />,
          <CountBadge count={12} label="12 pending items" />,
          <Stack
            items={[
              <Badge label="Observation only" />,
              <Text variant="bodySm" tone="muted">
                The badge stays compact above its longer explanation.
              </Text>,
              <Badge
                label="A longer status remains readable and wraps within a narrow container"
                tone="info"
              />,
            ]}
          />,
        ]}
      />
    )

    #API

    Generated from the package source. A property without a description has none in the source yet.

    #BadgeComponent

    PropertyDescriptionTypeDefault
    labelrequired–string–
    tone–Tone'neutral'
    value–string''
    size–'small' | 'default''default'
    icon–IconName–
    progress–never–

    #CountBadgeComponent

    PropertyDescriptionTypeDefault
    countrequired–number–
    labelrequired–string–
    announce–boolean–

    #TagComponent

    PropertyDescriptionTypeDefault
    labelrequired–string–
    href–string–
    removeHref–string | null–
    removeLabel–string | null–
    removeCommandA native form command; form can target an external form.{ name: string; value: string; form?: string }–
    disabled–boolean–
    truncate–boolean–

    #StatusComponent

    PropertyDescriptionTypeDefault
    labelrequired–string–
    tone–Tone–
    detail–string–

    #Types

    #Tone

    type Tone = 'neutral' | 'info' | 'positive' | 'warning' | 'danger'

    #BadgeProps

    The properties of Badge, listed above.

    #TagProps

    The properties of Tag, listed above.