Skip to content

Latest commit

 

History

History

storybook-dna

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

DNA Storybook

The library used to render Storybook stories with DNA.

This module is used internally by the @chialab/storybook-dna-vite package. If you are setting up a Storybook for DNA components, you should refer to this documentation.

API

The module exposes a set of APIs to enhance Storybook documentation.

getCustomElementsManifest()

This method can be used to retrieve a registered Custom Elements Manifest.

import { getCustomElementsManifest } from '@chialab/storybook-dna';

const manifest = getCustomElementsManifest();
manifest.modules.forEach(() => {
    //
});

setCustomElementsManifest(manifest)

Register a global Custom Elements Manifest.

import { setCustomElementsManifest } from '@chialab/storybook-dna';

setCustomElementsManifest({
    schemaVersion: '1.0.0',
    modules: [
        ...
    ],
});

mergeCustomElementsManifests(manifest1, manifest2)

Multiple generated manifests can be merged in a single global manifest.

import { getCustomElementsManifest, setCustomElementsManifest, mergeCustomElementsManifests } from '@chialab/storybook-dna';

const globalManifest = getCustomElementsManifest();
const manifest = {
    schemaVersion: '1.0.0',
    modules: [
        ...
    ],
};

setCustomElementsManifest(
    mergeCustomElementsManifests(globalManifest, manifest)
);

License

DNA Storybook are released under the MIT license.