@neuralfog/elemix-storybook
v0.9.5
Published
Readme
Elemix Storybook Integration
Storybook integration for elemix: a decorator that mounts elemix components into the story canvas, plus typed story helpers. Runs on @storybook/html-vite.
Use with @neuralfog/elemix-testing-library for any testing needs.
pnpm add -D @neuralfog/elemix-testing-libraryInstallation
pnpm add -D @neuralfog/elemix-storybook @neuralfog/elemix-vite @storybook/html-viteAdd the elemix Vite plugin in .storybook/main.ts:
import { elemix } from '@neuralfog/elemix-vite';
import type { StorybookConfig } from '@storybook/html-vite';
const config: StorybookConfig = {
stories: ['../stories/**/*.stories.ts'],
framework: '@storybook/html-vite',
viteFinal: (cfg) => {
cfg.plugins = [...(cfg.plugins ?? []), elemix()];
return cfg;
},
};
export default config;Register the decorator in .storybook/preview.ts:
import { elemixDecorator } from '@neuralfog/elemix-storybook';
import type { Preview } from '@storybook/html-vite';
const preview: Preview = {
decorators: [elemixDecorator],
};
export default preview;The full setup is shown in the elemix template.
