Skip to main content
Components

Tag

The Tag component indicates the status of something, such as an item on a task list or a phase banner.

Read the Design System guidance for tag

Import

import { Tag } from 'govuk-react/tag';

Examples

Default

Code
<Tag>
  Completed
</Tag>

Showing one or two statuses

Code
<Table.Composite
  head={
    <>
      <Table.ColumnHeader>Name of user</Table.ColumnHeader>
      <Table.ColumnHeader>Status</Table.ColumnHeader>
    </>
  }
>
  <Table.Row>
    <Table.Cell>Rachel Silver</Table.Cell>
    <Table.Cell>
      <Tag colour="grey">Inactive</Tag>
    </Table.Cell>
  </Table.Row>
  <Table.Row>
    <Table.Cell>Jesse Smith</Table.Cell>
    <Table.Cell>
      <Tag>Active</Tag>
    </Table.Cell>
  </Table.Row>
</Table.Composite>

Additional colours

Code
<Table.Composite
  head={
    <>
      <Table.ColumnHeader>Colour</Table.ColumnHeader>
      <Table.ColumnHeader>Tag</Table.ColumnHeader>
    </>
  }
>
  {colours.map(([colour, text]) => (
    <Table.Row key={colour ?? 'default'}>
      <Table.Cell>{colour ?? 'default'}</Table.Cell>
      <Table.Cell>
        <Tag colour={colour}>{text}</Tag>
      </Table.Cell>
    </Table.Row>
  ))}
</Table.Composite>

API reference

Tag

The Tag component indicates the status of something, such as an item on a task list or a phase banner.

PropType
colour"grey" | "green" | "teal" | "blue" | "light-blue" | "purple" | "magenta" | "red" | "orange" | "yellow"