burakyilmaz321 / django-components-storybook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django-components-storybook

Create Storybook stories for Django Components.

Inspired by View Component Storybook of Ruby on Rails View Component. Uses Storybook Server Framework.

Warning: This is a very early stage draft of the initial idea.

Usage

Add this to your url configuration:

urlpatterns = [
    # ...your existing url configuration
    path("storybook/components/", include("django_components_storybook.urls")),
]

Initialize Storybook:

npx storybook@latest init -t server

Add the following configuration to .storybook/preview.js

const preview = {
  parameters: {
    // ...existing configuration
    server: {
      url: `http://localhost:8000/storybook/components`,
    },
  },
};

Roadmap

  • Handle slots
  • Generate .storybook/preview-head.html
  • Generate stories automatically

About

License:MIT License


Languages

Language:Python 100.0%