Added storybook with example in thw preview.tsx
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
const config = {
|
||||
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
addons: ['@storybook/addon-links', '@storybook/addon-docs'],
|
||||
framework: {
|
||||
name: '@stencil/storybook-plugin',
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,15 @@
|
||||
// .storybook/preview.tsx
|
||||
import { defineCustomElements } from '../loader/index.js';
|
||||
import { setCustomElementsManifest } from '@stencil/storybook-plugin';
|
||||
import customElements from '../custom-elements.json';
|
||||
|
||||
/**
|
||||
* Registers all custom elements in the Storybook preview.
|
||||
*/
|
||||
defineCustomElements();
|
||||
|
||||
/**
|
||||
* Loads and registers component metadata for Storybook.
|
||||
* This enables automatic generation of props, methods, events, slots, shadow parts, and CSS variables tables.
|
||||
*/
|
||||
setCustomElementsManifest(customElements);
|
||||
Reference in New Issue
Block a user