TagGroup

Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request.

installyarn add @adobe/react-spectrum
added3.27.0
usageimport {TagGroup, Item} from '@adobe/react-spectrum'

Example#


<TagGroup aria-label="Static TagGroup items example">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup aria-label="Static TagGroup items example">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup aria-label="Static TagGroup items example">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>

Content#


TagGroup is a component that allows users to categorize content. Basic usage of TagGroup, seen in the example above, shows the use of a static collection where the contents of the TagGroup are hard coded. Dynamic collections, as shown below, can be used when the options come from an external data source such as an API, or update over time.

Each item has a unique key defined by the data. In the example below, the key of each row element is implicitly defined by the id property of the row object. See collections to learn more about keys in dynamic collections.

const items = [
  {id: 1, name: 'News'},
  {id: 2, name: 'Travel'},
  {id: 3, name: 'Gaming'},
  {id: 4, name: 'Shopping'}
];

<TagGroup items={items} aria-label="Dynamic TagGroup items example">
  {item => <Item>{item.name}</Item>}
</TagGroup>
const items = [
  { id: 1, name: 'News' },
  { id: 2, name: 'Travel' },
  { id: 3, name: 'Gaming' },
  { id: 4, name: 'Shopping' }
];

<TagGroup
  items={items}
  aria-label="Dynamic TagGroup items example"
>
  {(item) => <Item>{item.name}</Item>}
</TagGroup>
const items = [
  {
    id: 1,
    name: 'News'
  },
  {
    id: 2,
    name: 'Travel'
  },
  {
    id: 3,
    name: 'Gaming'
  },
  {
    id: 4,
    name: 'Shopping'
  }
];

<TagGroup
  items={items}
  aria-label="Dynamic TagGroup items example"
>
  {(item) => (
    <Item>
      {item.name}
    </Item>
  )}
</TagGroup>

Internationalization#

To internationalize a TagGroup, all text content within the TagGroup should be localized. This includes the aria-label provided to the TagGroup if any. For languages that are read right-to-left (e.g. Hebrew and Arabic), the layout of TagGroup is automatically flipped.

Labeling#


A visual label can be provided with the label prop. If a visual label isn't included, an aria-label must be provided to the TagGroup for accessibility. If the TagGroup is labeled by a separate element, an aria-labelledby prop must be provided using the id of the labeling element instead.

<TagGroup label="Categories">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup label="Categories">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup label="Categories">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>

Events#


onRemove#

Removing tags can be enabled by providing the onRemove prop to the TagGroup, which will receive the set of keys to remove.

function Example() {
  let defaultItems = [
    {id: 1, name: 'News'},
    {id: 2, name: 'Travel'},
    {id: 3, name: 'Gaming'},
    {id: 4, name: 'Shopping'}
  ];

  let [items, setItems] = React.useState(defaultItems);

  let onRemove = (keys) => {
    setItems(prevItems => prevItems.filter((item) => !keys.has(item.id)));
  };

  return (
    <TagGroup
      items={items}
      onRemove={onRemove}      aria-label="Removable TagGroup example">
      {item => <Item>{item.name}</Item>}
    </TagGroup>
  );
}
function Example() {
  let defaultItems = [
    { id: 1, name: 'News' },
    { id: 2, name: 'Travel' },
    { id: 3, name: 'Gaming' },
    { id: 4, name: 'Shopping' }
  ];

  let [items, setItems] = React.useState(defaultItems);

  let onRemove = (keys) => {
    setItems((prevItems) =>
      prevItems.filter((item) => !keys.has(item.id))
    );
  };

  return (
    <TagGroup
      items={items}
      onRemove={onRemove}      aria-label="Removable TagGroup example"
    >
      {(item) => <Item>{item.name}</Item>}
    </TagGroup>
  );
}
function Example() {
  let defaultItems = [
    {
      id: 1,
      name: 'News'
    },
    {
      id: 2,
      name: 'Travel'
    },
    {
      id: 3,
      name: 'Gaming'
    },
    {
      id: 4,
      name: 'Shopping'
    }
  ];

  let [items, setItems] =
    React.useState(
      defaultItems
    );

  let onRemove = (
    keys
  ) => {
    setItems(
      (prevItems) =>
        prevItems.filter(
          (item) =>
            !keys.has(
              item.id
            )
        )
    );
  };

  return (
    <TagGroup
      items={items}
      onRemove={onRemove}      aria-label="Removable TagGroup example"
    >
      {(item) => (
        <Item>
          {item.name}
        </Item>
      )}
    </TagGroup>
  );
}

onAction#

TagGroup supports an onAction handler that, when used with the actionLabel prop, will add an action button at the end of the tags that can be used to perform a custom action.

<TagGroup
  actionLabel="Clear"
  onAction={() => alert('Clear action pressed.')}  aria-label="TagGroup with action">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup
  actionLabel="Clear"
  onAction={() => alert('Clear action pressed.')}  aria-label="TagGroup with action">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup
  actionLabel="Clear"
  onAction={() =>
    alert(
      'Clear action pressed.'
    )}  aria-label="TagGroup with action"
>
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>

Tags may be links to another page or website. This can be achieved by passing the href prop to the <Item> component.

<TagGroup label="Links">
  <Item href="https://adobe.com/" target="_blank">Adobe</Item>
  <Item href="https://apple.com/" target="_blank">Apple</Item>
  <Item href="https://google.com/" target="_blank">Google</Item>
  <Item href="https://microsoft.com/" target="_blank">Microsoft</Item>
</TagGroup>
<TagGroup label="Links">
  <Item href="https://adobe.com/" target="_blank">
    Adobe
  </Item>
  <Item href="https://apple.com/" target="_blank">
    Apple
  </Item>
  <Item href="https://google.com/" target="_blank">
    Google
  </Item>
  <Item href="https://microsoft.com/" target="_blank">
    Microsoft
  </Item>
</TagGroup>
<TagGroup label="Links">
  <Item
    href="https://adobe.com/"
    target="_blank"
  >
    Adobe
  </Item>
  <Item
    href="https://apple.com/"
    target="_blank"
  >
    Apple
  </Item>
  <Item
    href="https://google.com/"
    target="_blank"
  >
    Google
  </Item>
  <Item
    href="https://microsoft.com/"
    target="_blank"
  >
    Microsoft
  </Item>
</TagGroup>

Client side routing#

The <Item> component works with frameworks and client side routers like Next.js and React Router. As with other React Spectrum components that support links, this works via the Provider component at the root of your app. See the client side routing guide to learn how to set this up.

Props#


NameTypeDefaultDescription
childrenCollectionChildren<T>The contents of the collection.
actionLabelstringThe label to display on the action button.
renderEmptyState() => JSX.ElementSets what the TagGroup should render when there are no tags to display.
maxRowsnumberLimit the number of rows initially shown. This will render a button that allows the user to expand to show all tags.
errorMessageReactNodeAn error message for the field.
itemsIterable<T>Item objects in the collection.
labelReactNodeThe content to display as the label.
descriptionReactNodeA description for the field. Provides a hint such as specific requirements for what to choose.
labelPositionLabelPosition'top'The label's overall position relative to the element it is labeling.
labelAlignAlignment'start'The label's horizontal alignment relative to the element it is labeling.
contextualHelpReactNodeA ContextualHelp element to place next to the label.
isInvalidbooleanWhether the input value is invalid.
Events
NameTypeDescription
onAction() => voidHandler that is called when the action button is pressed.
onRemove( (keys: Set<Key> )) => voidHandler that is called when a user deletes a tag.
Layout
NameTypeDescription
flexResponsive<stringnumberboolean>When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See MDN.
flexGrowResponsive<number>When used in a flex layout, specifies how the element will grow to fit the space available. See MDN.
flexShrinkResponsive<number>When used in a flex layout, specifies how the element will shrink to fit the space available. See MDN.
flexBasisResponsive<numberstring>When used in a flex layout, specifies the initial main size of the element. See MDN.
alignSelfResponsive<'auto''normal''start''end''center''flex-start''flex-end''self-start''self-end''stretch'>Overrides the alignItems property of a flex or grid container. See MDN.
justifySelfResponsive<'auto''normal''start''end''flex-start''flex-end''self-start''self-end''center''left''right''stretch'>Specifies how the element is justified inside a flex or grid container. See MDN.
orderResponsive<number>The layout order for the element within a flex or grid container. See MDN.
gridAreaResponsive<string>When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See MDN.
gridColumnResponsive<string>When used in a grid layout, specifies the column the element should be placed in within the grid. See MDN.
gridRowResponsive<string>When used in a grid layout, specifies the row the element should be placed in within the grid. See MDN.
gridColumnStartResponsive<string>When used in a grid layout, specifies the starting column to span within the grid. See MDN.
gridColumnEndResponsive<string>When used in a grid layout, specifies the ending column to span within the grid. See MDN.
gridRowStartResponsive<string>When used in a grid layout, specifies the starting row to span within the grid. See MDN.
gridRowEndResponsive<string>When used in a grid layout, specifies the ending row to span within the grid. See MDN.
Spacing
NameTypeDescription
marginResponsive<DimensionValue>The margin for all four sides of the element. See MDN.
marginTopResponsive<DimensionValue>The margin for the top side of the element. See MDN.
marginBottomResponsive<DimensionValue>The margin for the bottom side of the element. See MDN.
marginStartResponsive<DimensionValue>The margin for the logical start side of the element, depending on layout direction. See MDN.
marginEndResponsive<DimensionValue>The margin for the logical end side of an element, depending on layout direction. See MDN.
marginXResponsive<DimensionValue>The margin for both the left and right sides of the element. See MDN.
marginYResponsive<DimensionValue>The margin for both the top and bottom sides of the element. See MDN.
Sizing
NameTypeDescription
widthResponsive<DimensionValue>The width of the element. See MDN.
minWidthResponsive<DimensionValue>The minimum width of the element. See MDN.
maxWidthResponsive<DimensionValue>The maximum width of the element. See MDN.
heightResponsive<DimensionValue>The height of the element. See MDN.
minHeightResponsive<DimensionValue>The minimum height of the element. See MDN.
maxHeightResponsive<DimensionValue>The maximum height of the element. See MDN.
Positioning
NameTypeDescription
positionResponsive<'static''relative''absolute''fixed''sticky'>Specifies how the element is positioned. See MDN.
topResponsive<DimensionValue>The top position for the element. See MDN.
bottomResponsive<DimensionValue>The bottom position for the element. See MDN.
leftResponsive<DimensionValue>The left position for the element. See MDN. Consider using start instead for RTL support.
rightResponsive<DimensionValue>The right position for the element. See MDN. Consider using start instead for RTL support.
startResponsive<DimensionValue>The logical start position for the element, depending on layout direction. See MDN.
endResponsive<DimensionValue>The logical end position for the element, depending on layout direction. See MDN.
zIndexResponsive<number>The stacking order for the element. See MDN.
isHiddenResponsive<boolean>Hides the element.
Accessibility
NameTypeDescription
idstringThe element's unique identifier. See MDN.
aria-labelstringDefines a string value that labels the current element.
aria-labelledbystringIdentifies the element (or elements) that labels the current element.
aria-describedbystringIdentifies the element (or elements) that describes the object.
aria-detailsstringIdentifies the element (or elements) that provide a detailed, extended description for the object.
Advanced
NameTypeDescription
UNSAFE_classNamestringSets the CSS className for the element. Only use as a last resort. Use style props instead.
UNSAFE_styleCSSPropertiesSets inline style for the element. Only use as a last resort. Use style props instead.

Visual options#


With icons#

<TagGroup aria-label="TagGroup with icons example">
  <Item textValue="News">
    <News />
    <Text>News</Text>
  </Item>
  <Item textValue="Travel">
    <Airplane />
    <Text>Travel</Text>
  </Item>
  <Item textValue="Gaming">
    <Game />
    <Text>Gaming</Text>
  </Item>
  <Item textValue="Shopping">
    <ShoppingCart />
    <Text>Shopping</Text>
  </Item>
</TagGroup>
<TagGroup aria-label="TagGroup with icons example">
  <Item textValue="News">
    <News />
    <Text>News</Text>
  </Item>
  <Item textValue="Travel">
    <Airplane />
    <Text>Travel</Text>
  </Item>
  <Item textValue="Gaming">
    <Game />
    <Text>Gaming</Text>
  </Item>
  <Item textValue="Shopping">
    <ShoppingCart />
    <Text>Shopping</Text>
  </Item>
</TagGroup>
<TagGroup aria-label="TagGroup with icons example">
  <Item textValue="News">
    <News />
    <Text>News</Text>
  </Item>
  <Item textValue="Travel">
    <Airplane />
    <Text>Travel</Text>
  </Item>
  <Item textValue="Gaming">
    <Game />
    <Text>Gaming</Text>
  </Item>
  <Item textValue="Shopping">
    <ShoppingCart />
    <Text>
      Shopping
    </Text>
  </Item>
</TagGroup>

With avatars#

<TagGroup aria-label="TagGroup with avatars example">
  <Item textValue="Person 1">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 1</Text>
  </Item>
  <Item textValue="Person 2">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 2</Text>
  </Item>
  <Item textValue="Person 3">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 3</Text>
  </Item>
  <Item textValue="Person 4">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 4</Text>
  </Item>
</TagGroup>
<TagGroup aria-label="TagGroup with avatars example">
  <Item textValue="Person 1">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 1</Text>
  </Item>
  <Item textValue="Person 2">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 2</Text>
  </Item>
  <Item textValue="Person 3">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 3</Text>
  </Item>
  <Item textValue="Person 4">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>Person 4</Text>
  </Item>
</TagGroup>
<TagGroup aria-label="TagGroup with avatars example">
  <Item textValue="Person 1">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>
      Person 1
    </Text>
  </Item>
  <Item textValue="Person 2">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>
      Person 2
    </Text>
  </Item>
  <Item textValue="Person 3">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>
      Person 3
    </Text>
  </Item>
  <Item textValue="Person 4">
    <Avatar src="https://i.imgur.com/kJOwAdv.png" />
    <Text>
      Person 4
    </Text>
  </Item>
</TagGroup>

Label position and alignment#

By default, the label is positioned above the TagGroup. The labelPosition prop can be used to position the label to the side. The labelAlign prop can be used to align the label as "start" or "end". For left-to-right (LTR) languages, "start" refers to the left most edge of the TagGroup and "end" refers to the right most edge. For right-to-left (RTL) languages, this is flipped.

<TagGroup label="Categories" labelPosition="side" labelAlign="end">
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup
  label="Categories"
  labelPosition="side"
  labelAlign="end"
>
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
<TagGroup
  label="Categories"
  labelPosition="side"
  labelAlign="end"
>
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>

Help text#

View guidelines

Both a description and an error message can be supplied to a TagGroup. The description is always visible unless isInvalid is true and an error message is provided. The error message can be used to help the user fix their input quickly and should be specific to the detected error. All strings should be localized.

function Example() {
  let defaultItems = [
    {id: 1, name: 'News'},
    {id: 2, name: 'Travel'},
    {id: 3, name: 'Gaming'},
    {id: 4, name: 'Shopping'}
  ];

  let [items, setItems] = React.useState(defaultItems);

  let onRemove = (keys) => {
    setItems(prevItems => prevItems.filter((item) => !keys.has(item.id)));
  };

  let isValid = items.length <= 3;

  return (
    <TagGroup
      label="Categories"
      items={items}
      onRemove={onRemove}
      aria-label="TagGroup help text example"
      isInvalid={!isValid}
      description="Please include tags for related categories."
      errorMessage="Must contain no more than 3 tags. Please remove some."
      >
      {item => <Item>{item.name}</Item>}
    </TagGroup>
  );
}
function Example() {
  let defaultItems = [
    { id: 1, name: 'News' },
    { id: 2, name: 'Travel' },
    { id: 3, name: 'Gaming' },
    { id: 4, name: 'Shopping' }
  ];

  let [items, setItems] = React.useState(defaultItems);

  let onRemove = (keys) => {
    setItems((prevItems) =>
      prevItems.filter((item) => !keys.has(item.id))
    );
  };

  let isValid = items.length <= 3;

  return (
    <TagGroup
      label="Categories"
      items={items}
      onRemove={onRemove}
      aria-label="TagGroup help text example"
      isInvalid={!isValid}
      description="Please include tags for related categories."
      errorMessage="Must contain no more than 3 tags. Please remove some."
    >
      {(item) => <Item>{item.name}</Item>}
    </TagGroup>
  );
}
function Example() {
  let defaultItems = [
    {
      id: 1,
      name: 'News'
    },
    {
      id: 2,
      name: 'Travel'
    },
    {
      id: 3,
      name: 'Gaming'
    },
    {
      id: 4,
      name: 'Shopping'
    }
  ];

  let [items, setItems] =
    React.useState(
      defaultItems
    );

  let onRemove = (
    keys
  ) => {
    setItems(
      (prevItems) =>
        prevItems.filter(
          (item) =>
            !keys.has(
              item.id
            )
        )
    );
  };

  let isValid =
    items.length <= 3;

  return (
    <TagGroup
      label="Categories"
      items={items}
      onRemove={onRemove}
      aria-label="TagGroup help text example"
      isInvalid={!isValid}
      description="Please include tags for related categories."
      errorMessage="Must contain no more than 3 tags. Please remove some."
    >
      {(item) => (
        <Item>
          {item.name}
        </Item>
      )}
    </TagGroup>
  );
}

Contextual help#

A ContextualHelp element may be placed next to the label to provide additional information or help about a TagGroup.

import {Content, ContextualHelp, Heading} from '@adobe/react-spectrum';

<TagGroup
  label="Categories"
  contextualHelp={
    <ContextualHelp>
      <Heading>What are tags?</Heading>
      <Content>Tags allow users to categorize content.</Content>
    </ContextualHelp>
  }>
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
import {
  Content,
  ContextualHelp,
  Heading
} from '@adobe/react-spectrum';

<TagGroup
  label="Categories"
  contextualHelp={
    <ContextualHelp>
      <Heading>What are tags?</Heading>
      <Content>
        Tags allow users to categorize content.
      </Content>
    </ContextualHelp>
  }
>
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>
import {
  Content,
  ContextualHelp,
  Heading
} from '@adobe/react-spectrum';

<TagGroup
  label="Categories"
  contextualHelp={
    <ContextualHelp>
      <Heading>
        What are tags?
      </Heading>
      <Content>
        Tags allow
        users to
        categorize
        content.
      </Content>
    </ContextualHelp>
  }
>
  <Item>News</Item>
  <Item>Travel</Item>
  <Item>Gaming</Item>
  <Item>Shopping</Item>
</TagGroup>

Limit rows#

TagGroup supports a maxRows prop that will limit the number of rows initially shown. This will add an action button that can be pressed to show the remaining tags.

<View
  maxWidth="size-3400"
  minHeight="size-2000"
  padding="size-150"
  borderWidth="thin"
  borderColor="dark"
  borderRadius="medium"
>
  <TagGroup
    maxRows={2}    aria-label="Static TagGroup items example with maxRows set"
  >
    <Item>News</Item>
    <Item>Travel</Item>
    <Item>Gaming</Item>
    <Item>Shopping</Item>
    <Item>Business</Item>
    <Item>Entertainment</Item>
    <Item>Food</Item>
    <Item>Technology</Item>
    <Item>Politics</Item>
    <Item>Health</Item>
    <Item>Science</Item>
  </TagGroup>
</View>
<View
  maxWidth="size-3400"
  minHeight="size-2000"
  padding="size-150"
  borderWidth="thin"
  borderColor="dark"
  borderRadius="medium"
>
  <TagGroup
    maxRows={2}    aria-label="Static TagGroup items example with maxRows set"
  >
    <Item>News</Item>
    <Item>Travel</Item>
    <Item>Gaming</Item>
    <Item>Shopping</Item>
    <Item>Business</Item>
    <Item>Entertainment</Item>
    <Item>Food</Item>
    <Item>Technology</Item>
    <Item>Politics</Item>
    <Item>Health</Item>
    <Item>Science</Item>
  </TagGroup>
</View>
<View
  maxWidth="size-3400"
  minHeight="size-2000"
  padding="size-150"
  borderWidth="thin"
  borderColor="dark"
  borderRadius="medium"
>
  <TagGroup
    maxRows={2}    aria-label="Static TagGroup items example with maxRows set"
  >
    <Item>News</Item>
    <Item>Travel</Item>
    <Item>Gaming</Item>
    <Item>
      Shopping
    </Item>
    <Item>
      Business
    </Item>
    <Item>
      Entertainment
    </Item>
    <Item>Food</Item>
    <Item>
      Technology
    </Item>
    <Item>
      Politics
    </Item>
    <Item>Health</Item>
    <Item>
      Science
    </Item>
  </TagGroup>
</View>

Empty state#

Use the renderEmptyState prop to customize what the TagGroup will display if there are no tags provided.

import {Link} from '@adobe/react-spectrum';

function renderEmptyState() {
  return (
    <span>
      No categories.{' '}
      <Link>
        <a href="//react-spectrum.com">Click here</a>
      </Link>{' '}
      to add some.
    </span>
  );
}

<TagGroup
  label="Categories"
  renderEmptyState={renderEmptyState}
>
  {[]}
</TagGroup>
import {Link} from '@adobe/react-spectrum';

function renderEmptyState() {
  return (
    <span>
      No categories.{' '}
      <Link>
        <a href="//react-spectrum.com">Click here</a>
      </Link>{' '}
      to add some.
    </span>
  );
}

<TagGroup
  label="Categories"
  renderEmptyState={renderEmptyState}
>
  {[]}
</TagGroup>
import {Link} from '@adobe/react-spectrum';

function renderEmptyState() {
  return (
    <span>
      No categories.{' '}
      <Link>
        <a href="//react-spectrum.com">
          Click here
        </a>
      </Link>{' '}
      to add some.
    </span>
  );
}

<TagGroup
  label="Categories"
  renderEmptyState={renderEmptyState}
>
  {[]}
</TagGroup>