Back to Storybook

Foo Bar Baz Story

docs/_snippets/foo-bar-baz-story.md

10.3.67.3 KB
Original Source
ts
import type { Meta, StoryObj } from '@storybook/angular';

import { Foo } from './foo.component';

const meta: Meta<Foo> = {
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
};

export default meta;
type Story = StoryObj<Foo>;

export const Baz: Story = {};
ts
import preview from '../.storybook/preview';

import { Foo } from './foo.component';

const meta = preview.meta({
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
});

export const Baz = meta.story();
svelte
<script module>
  import { defineMeta } from '@storybook/addon-svelte-csf';

  import Foo from './Foo.svelte';

  const { Story } = defineMeta({
    /* ๐Ÿ‘‡ The title prop is optional.
     * See https://storybook.js.org/docs/configure/#configure-story-loading
     * to learn how to generate automatic titles
     */
    title: 'Foo/Bar',
    component: Foo,
  });
</script>

<Story name="Baz" />
js
import Foo from './Foo.svelte';

export default {
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
};

export const Baz = {};
js
import { Foo } from './Foo';

export default {
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
};

export const Baz = {};
svelte
<script module>
  import { defineMeta } from '@storybook/addon-svelte-csf';

  import Foo from './Foo.svelte';

  const { Story } = defineMeta({
    /* ๐Ÿ‘‡ The title prop is optional.
     * See https://storybook.js.org/docs/configure/#configure-story-loading
     * to learn how to generate automatic titles
     */
    title: 'Foo/Bar',
    component: Foo,
  });
</script>

<Story name="Baz" />
ts
// Replace your-framework with svelte-vite or sveltekit
import type { Meta, StoryObj } from '@storybook/your-framework';

import Foo from './Foo.svelte';

const meta = {
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
} satisfies Meta<typeof Foo>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Baz: Story = {};
ts
// Replace your-framework with the name of your framework
import type { Meta, StoryObj } from '@storybook/your-framework';

import { Foo } from './Foo';

const meta = {
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
} satisfies Meta<typeof Foo>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Baz: Story = {};
ts
import preview from '../.storybook/preview';

import { Foo } from './Foo';

const meta = preview.meta({
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
});

export const Baz = meta.story();
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
import preview from '../.storybook/preview';

import { Foo } from './Foo';

const meta = preview.meta({
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
});

export const Baz = meta.story();
ts
import preview from '../.storybook/preview';

import Foo from './Foo.vue';

const meta = preview.meta({
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
});

export const Baz = meta.story();
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
import preview from '../.storybook/preview';

import Foo from './Foo.vue';

const meta = preview.meta({
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: Foo,
});

export const Baz = meta.story();
js
export default {
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: 'demo-foo',
};

export const Baz = {};
ts
import type { Meta, StoryObj } from '@storybook/web-components-vite';

const meta: Meta = {
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: 'demo-foo',
};

export default meta;
type Story = StoryObj;

export const Baz: Story = {};
js
import preview from '../.storybook/preview';

const meta = preview.meta({
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: 'demo-foo',
});

export const Baz = meta.story();
ts
import preview from '../.storybook/preview';

const meta = preview.meta({
  /* ๐Ÿ‘‡ The title prop is optional.
   * See https://storybook.js.org/docs/configure/#configure-story-loading
   * to learn how to generate automatic titles
   */
  title: 'Foo/Bar',
  component: 'demo-foo',
});

export const Baz = meta.story();