Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions packages/@react-spectrum/tag/docs/TagGroup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,25 @@ TagGroup supports a `maxRows` prop that will limit the number of rows initially
</TagGroup>
</View>
```

### Empty state

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

```tsx example
import {Link} from '@react-spectrum/link';

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>
```