Better Programming

Advice for programmers.

Follow publication

Member-only story

Getting Started With Storybook Without a JavaScript Framework

Use it with plain HTML and CSS

RayRay
Better Programming
Published in
4 min readJun 4, 2021

Book on wooden path
Photo by Ksenia Makagonova on Unsplash.

We all want to use well-documented UI components in our frontend. With Storybook, you can do that reasonably quickly with React, Angular, Vue, or any other framework.

But since the documentation lacks clear information about how to set up Storybook without any JavaScript framework, I’m going to write it all down for you because it is possible to use plain HTML and CSS.

If you want to learn more about why you should use Storybook, check out Why You Should Always Use Storybook When Developing User Interfaces by Tyler Hawkins.

Installation

Add Storybook by running the following command in the terminal:

npx sb init

This command will add all the dependencies for Storybook and create initial files so that you can get started right away.

After the installation, you will see this question: “Do you want to manually choose a Storybook project type to install?” Type “yes.” Then “Please choose a project type from the list” will appear. For this, type “HTML.”

Now the CLI will set everything up to use Storybook with plain HTML.

RayRay
RayRay

Written by RayRay

I’m a 🇳🇱 lead frontend developer who writes about WebDev | JavaScript | TypeScript | Vuejs | Design Systems | NuxtJS | CSS https://www.youtube.com/@devbyray

Responses (2)

Write a response