Storybook for Nuxt framework
Storybook package for Nuxt framework with zero configs. seamless integration supporting all Nuxt fancy features
https://github.com/storybook-vue/nuxt/assets/711292/e66a1899-ab7c-42dd-b358-59e22ff0f609
Supported Features
👉 All in-built Nuxt Components
👉 JSX
👉 Postcss
👉 Typescript (already supported out of the box by Storybook)
👉 Nuxt DevTools : finally as Bonus, Nuxt DevTools works amazingly with your Storybook, full features
https://github.com/storybook-vue/nuxt/assets/711292/63cc1fb3-ec6b-4df2-ad61-d87e5692f385
Requirements
Getting Started
Install @storybook-vue/nuxt next to Storybook 11, published under the next tag until its release:
npm install -D @storybook-vue/nuxt storybook@next @storybook/addon-docs@next
Then point .storybook/main.ts to the framework with CSF Factories:
// .storybook/main.ts
import { defineMain } from '@storybook-vue/nuxt/node'
export default defineMain({
stories: ['../components/**/*.stories.ts'],
addons: ['@storybook/addon-docs'],
framework: '@storybook-vue/nuxt',
})
// .storybook/preview.ts
import addonDocs from '@storybook/addon-docs'
import { definePreview } from '@storybook-vue/nuxt'
export default definePreview({
addons: [addonDocs()],
})
Run storybook dev to start Storybook on its own port, or add the @nuxtjs/storybook module to serve it from nuxt dev.
Documentation
Read the Nuxt Storybook documentation for the configuration, parameters.nuxt, and the mockNuxtImport, mockComponent and registerEndpoint helpers.
License
This repository is licensed under the MIT License. Feel free to use the code and modify it according to your needs.
Contacts :
🔖 Mail: javachakir@gmail.com
💬 Discord: ChakAs3
🐦⬛ Twitter: @ChakirQatab