Storybook framework

TypeScript

Type your Storybook configuration and stories.

Import the Storybook types, such as Meta and StoryObj, from @storybook-vue/nuxt instead of @storybook/vue3-vite: the framework re-exports them, typed with parameters.nuxt. @nuxtjs/storybook re-exports the same types.

With CSF Factories, the types come from the factories: defineMain types .storybook/main.ts, definePreview types .storybook/preview.ts, and preview.meta() and meta.story() infer the component props in your stories. Install @storybook-vue/nuxt next to @nuxtjs/storybook so your project can import it.

import { 
defineMain
} from '@storybook-vue/nuxt/node'
export default
defineMain
({
stories
: ['../components/**/*.stories.ts'],
addons
: ['@storybook/addon-docs'],
framework
: '@storybook-vue/nuxt',
})