Skip to content

Commit

Permalink
Mention badges addon
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed May 7, 2024
1 parent b44b838 commit 348d23b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/writing-stories/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Tags'
---

Tags allow you to control which stories are included in your Storybook, enabling many different uses of the same total set of stories. For example, you can use tags to include/exclude tests from the [test runner](../writing-tests/test-runner.md#run-tests-for-a-subset-of-stories). For more complex use cases, see the [recipes](#recipes) section, below.
Tags allow you to control which stories are included in your Storybook, enabling many different uses of the same total set of stories. For example, you can use tags to include/exclude tests from the [test runner](../writing-tests/test-runner.md#run-tests-for-a-subset-of-stories) or display [badges](https://storybook.js.org/addons/@geometricpanda/storybook-addon-badges/). For more complex use cases, see the [recipes](#recipes) section, below.

## Built-in tags

Expand Down Expand Up @@ -76,7 +76,7 @@ export const ExperimentalFeatureStory: Story = {

## Removing tags

To remove a tag from a story, prefix it with `!`. For example:
To remove a tag from a story, prefix it with `!`. For example, we can apply the `stable` tag to all stories in a file except one, which has the `experimental` tag:

```ts
// Button.stories.ts
Expand All @@ -102,6 +102,12 @@ export const ExperimentalFeatureStory: Story = {
};
```

<Callout variant="info">

Tags like `stable` and `experimental` work very well with an addon like [badges](https://storybook.js.org/addons/@geometricpanda/storybook-addon-badges/).

</Callout>

Tags can be removed for all stories in your project (in `.storybook/preview.js|ts`), all stories for a component (in the CSF file meta), or a single story (as above).

## Recipes
Expand Down

0 comments on commit 348d23b

Please sign in to comment.