@storybook/web-components
- Version 8.3.1
- Published
- 62.5 kB
- 7 dependencies
- MIT license
Install
npm i @storybook/web-components
yarn add @storybook/web-components
pnpm add @storybook/web-components
Overview
Storybook web-components renderer
Index
Functions
function getCustomElements
getCustomElements: () => any;
function isValidComponent
isValidComponent: (tagName: string) => boolean;
function isValidMetaData
isValidMetaData: (customElements: any) => boolean;
function setCustomElements
setCustomElements: (customElements: any) => void;
Parameter customElements
any
for now as spec is not super stable yet
function setCustomElementsManifest
setCustomElementsManifest: (customElements: any) => void;
function setProjectAnnotations
setProjectAnnotations: ( projectAnnotations: | NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]) => NormalizedProjectAnnotations<WebComponentsRenderer>;
Function that sets the globalConfig of your storybook. The global config is the preview module of your .storybook folder.
It should be run a single time, so that your global config (e.g. decorators) is applied to your stories when using
composeStories
orcomposeStory
.Example:
// setup-file.jsimport { setProjectAnnotations } from '@storybook/web-components';import projectAnnotations from './.storybook/preview';setProjectAnnotations(projectAnnotations);Parameter projectAnnotations
E.g. (import projectAnnotations from '../.storybook/preview')
Interfaces
interface WebComponentsRenderer
interface WebComponentsRenderer extends WebRenderer {}
property component
component: string;
property storyResult
storyResult: StoryFnHtmlReturnType;
Type Aliases
type Decorator
type Decorator<TArgs = StrictArgs> = DecoratorFunction<WebComponentsRenderer, TArgs>;
type Loader
type Loader<TArgs = StrictArgs> = LoaderFunction<WebComponentsRenderer, TArgs>;
type Meta
type Meta<TArgs = Args> = ComponentAnnotations<WebComponentsRenderer, TArgs>;
Metadata to configure the stories for a component.
See Also
[Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
type Preview
type Preview = ProjectAnnotations<WebComponentsRenderer>;
type StoryContext
type StoryContext<TArgs = StrictArgs> = StoryContext$1<WebComponentsRenderer, TArgs>;
type StoryFn
type StoryFn<TArgs = Args> = AnnotatedStoryFn<WebComponentsRenderer, TArgs>;
Story function that represents a CSFv2 component example.
See Also
[Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
type StoryObj
type StoryObj<TArgs = Args> = StoryAnnotations<WebComponentsRenderer, TArgs>;
Story object that represents a CSFv3 component example.
See Also
[Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
Package Files (2)
Dependencies (7)
Dev Dependencies (6)
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@storybook/web-components
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@storybook/web-components)
- HTML<a href="https://www.jsdocs.io/package/@storybook/web-components"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3167 ms. - Missing or incorrect documentation? Open an issue for this package.