Storybook: render Story only in Docs tab (not a separate one)

679 views Asked by At

I'm using newest version of Storybook (v.7) and creating a story called Example per each component. I also have autodocs turned on. Therefore I end up with two tabs per component:

  • Docs
  • Example

However by default the story is added inside the Docs anyway. I don't see the point then in having them as a separate tabs too. Is there a way to create a story per component, but just keep it inside the docs only and do not render as a separate tab?

Some piece of code of a file Component.stories.tsx:

const meta: Meta<typeof Component> = {
  title: 'Component',
  component: Component,
};

export default meta;

type Story = StoryObj<typeof Component>;

export const Example: Story = {
  args: {
    title: 'Component Title',
  },
};
0

There are 0 answers