@chialab/storybook-dna
TypeScript icon, indicating that this package has built-in type declarations

8.0.7 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i @chialab/storybook-dna

Weekly Downloads

11

Version

8.0.7

License

MIT

Unpacked Size

49 kB

Total Files

25

Last publish

Collaborators

  • chialab-admin
  • chialab-developers