Skip to content

Tag

A label that classifies a thing: a topic, a kind, a word the person chose. It never says a state; that is a Badge or a Status.

import { Tag, TagSkeleton } from '@sypnia/ui/react'

On this page
  1. Labels of a table
  2. When to use it
  3. For everyone
  4. Props

Labels of a table

billingenv:prodteam:growthread-only
Code
import { useState } from 'react';
import { Tag, TagSkeleton } from '@sypnia/ui/react';

// Words that classify. Remove one with its ×. The last one is the skeleton.
export default function Labels() {
  const [tags, setTags] = useState(['billing', 'env:prod', 'team:growth']);
  return (
    <div className="sy-row">
      {tags.map((t) => <Tag key={t} machine={t.includes(':')} onRemove={() => setTags(tags.filter((x) => x !== t))}>{t}</Tag>)}
      <Tag>read-only</Tag>
      <TagSkeleton />
    </div>
  );
}

When to use it

Use it when

  • Labels people add to projects, tables or files.
  • machine for labels written as code: env:prod.

Do not use it when

  • States such as «Active» or «Failed»: use Badge or Status.
  • Filters that are on: use FilterChip.

For everyone

  • The × is a button named «Remove billing».

Props

TagTypeDefault
machine boolean
onRemove (() => void)
removeLabel string
  1. Labels of a table
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms