@antadesign/anta
    Preparing search index...

    Interface TagPropsUnreviewed

    Common props for JSX component wrappers.

    interface TagProps {
        label?: string;
        value?: string;
        tone?:
            | "neutral"
            | "brand"
            | "info"
            | "success"
            | "warning"
            | "critical"
            | string & {};
        priority?: "primary"
        | "secondary"
        | "tertiary";
        size?: "small" | "medium" | "large";
        allcaps?: boolean;
        icon?: keyof IconShapes;
        iconTrailing?: keyof IconShapes;
        className?: string;
        style?: CSSProperties;
        children?: ReactNode;
        id?: string;
        title?: string;
        slot?: string;
        tabIndex?: number;
        key?: string | number | null;
        [key: `data-${string}`]: unknown;
        [key: `aria-${string}`]: unknown;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: `data-${string}`]: unknown

      Any data-* attribute is forwarded to the rendered element.

    • [key: `aria-${string}`]: unknown

      Any aria-* attribute is forwarded to the rendered element.

    Index
    label?: string

    A short "key" shown before the value. When paired with value it renders bold (weight 600), same color. On its own (no value) it's treated as the tag's primary text and keeps the default styling.

    value?: string

    The tag's primary text — a status, count, version, duration, etc. Rendered in the default color and weight, with no divider from the label; the color + weight contrast does the separating.

    tone?:
        | "neutral"
        | "brand"
        | "info"
        | "success"
        | "warning"
        | "critical"
        | string & {}

    Semantic tone, or any literal CSS color ('#ff1493', 'rebeccapurple') for a one-off custom tone. Each tone renders the secondary tag style: --text-3-{tone} text over an alpha tint of the tone's hue (fill + a slightly stronger hairline border). A custom color is tinted the same way, with the text deepened to a readable foreground. 'neutral' (the default) is the gray tag — the same as omitting tone.

    neutral
    
    priority?: "primary" | "secondary" | "tertiary"

    Emphasis level. secondary (the default) is the subtle alpha-tint fill; primary is a solid fill with white text; tertiary is a transparent outline. Omitting it (or passing 'secondary') renders the default and emits no DOM attribute.

    secondary
    
    size?: "small" | "medium" | "large"

    Size variant. small = 16px tall, medium = 20px, large = 24px (matching Button). Omit the attribute or pass 'medium' for the default — both render identically and emit no DOM attribute.

    medium
    
    allcaps?: boolean

    Render in all-caps instead of the default normal (mixed) case.

    icon?: keyof IconShapes

    Leading icon shape. Sits flush before the label, scaled to the pill.

    iconTrailing?: keyof IconShapes

    Trailing icon shape. Renders last, after the value.

    className?: string

    CSS class on the component's root element (merged with the component's own classes). Use it directly for layout and positioning — grid/flex placement, margins, alignment — rather than wrapping the component in a <div>/<span>.

    style?: CSSProperties

    Inline styles on the component's root element. Set layout/positioning here (or via className) directly on the component instead of adding a wrapper.

    children?: ReactNode

    Child elements. When provided, replaces the component's default label/content.

    id?: string

    HTML id attribute.

    title?: string

    HTML title attribute — native browser tooltip on hover.

    slot?: string

    Assigns the element to a named <slot> of a parent web component (e.g. slot="header" inside a <Card>, slot="footer" inside a <Dialog>).

    tabIndex?: number

    Tab order. Set to -1 to skip the element when tabbing.

    key?: string | number | null

    React/Preact reconciliation key when rendered inside a list. Consumed by the JSX runtime (not forwarded as a DOM attribute).