A component library built with Lit Element web components and Storybook.
VSCode with ES6 and Lit plugin support.
npm installnpm startnpm run storybooknpm run buildnpm run build-storybooktrailhand-ui/
├── Components/ # Web components
├── stories/ # Storybook stories
├── .storybook/ # Storybook configuration
│ ├── main.js
│ └── preview.js
├── index.html # Demo page
└── package.json
This library uses Lit Element for building fast, lightweight web components. Web components are framework-agnostic and work with any JavaScript framework or vanilla JS.
- Framework agnostic
- Encapsulated styles and functionality
- Reusable across projects
- Based on web standards
Learn more at lit.dev
Storybook provides an isolated environment for component development and documentation.
Storybook was initialized using:
npm create storybook@latestConfiguration:
- Framework:
@storybook/web-components-vite - Addons:
addon-essentials,addon-a11y - ES Modules:
"type": "module"in package.json - Version: 8.6.14 (for Node.js v20.18.0 compatibility)
Every component should have stories that demonstrate its various states and configurations.
export default {
title: 'Components/ComponentName',
tags: ['autodocs'],
};
export const Default = {
args: {
// component props
},
};- Lit Element 3.3.1 - Web component library
- Vite 6.4.1 - Build tool
- Storybook 8.6.14 - Component documentation
- Node.js v20.18.0+