This is a minimal setup of a Drupal 10 theme with Storybook support. It uses ViteJS as its build tool which offers HMR and some ESLint rules. The project still lacks many of the automation found in most modern front-end projects. The main objective of this project is to show how Storybook is able to render components that were written in Twig.
Note: You need NodeJS 18 or higher.
- Clone this repo
- Run
cd storybook
(or the directory name you used when cloning the repo) - Run
nvm install
- You need to have nvm installed. This project uses NodeJS v20.5 - Run
npm install
- This will install all the npm packages inpackage.json
- Run
npm run storybook
- Will build and launch Storybook in the browser.
You should see the Title Story. If you change the values in the Controls, you will be able to alter the title's behavior. Try it.
.nvmrc
in the root of this project defines the version of NodeJS this project uses.index.html
in the root of the project was added by ViteJS. You can ignore it and even delete it.storybook.info.yml
andstorybook.libraries.yml
are only for demo purposes.
by: Mario Hernandez