Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python typings for Storybook and the Component Story Format (CSF)

License

Notifications You must be signed in to change notification settings

JuroOravec/storybook-csf

Repository files navigation

storybook-csf

PyPI - Version PyPI - Python Version PyPI - License PyPI - Downloads GitHub Actions Workflow Status

Write Storybook stories in Python - Typings for Storybook's Component Story Format (CSF) v3.

The types defined in this package allow you to write Storybook's CSF format in your Python projects. See included types here.

NOTE: The types defined in this package are a JSON-compatible subset of CSF. Fields that require JS-specific types are not included.

from storybook_csf import ComponentAnnotations, ProjectAnnotations, StoryAnnotations

# This will be typed
data: ComponentAnnotations = {
    "title": "Component",
    "parameters": {
        "options": { "component": "my_widget" }
    },
    # `stories` field is specific to Storybook for Server
    # See https://github.com/storybookjs/storybook/tree/next/code/frameworks/server-webpack5
    "stories": [
        {
            "name": "Default",
            "parameters": {
                "server": { "id": "path/of/your/story" }
            }
        }
    ]
}

Installation

pip install storybook-csf

Release notes

Read the Release Notes to see the latest features and fixes.

Development

Tests

To run tests, use:

pytest

About

Python typings for Storybook and the Component Story Format (CSF)

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •