Lightning web component Demo Generator
Focus on writing your Lightining web components and leave the documentation generation to
lwc-demo. Features include:
- Built with LWC!
- Ideal for https://github.io
- Easy to navigte with a mobile friendly design
- JSdoc parsing
- Markdown with smart defaults
git clone lwc-democd lwc-demonpm installnpm link ../path-to-modulenpm link module-namenpm run watch
Learn more about
npm link. This will allow live reload of a local component.
When you are ready to generate the static website...
npm run build
- Copy the contents of the
This uses webpack to read everything and generate documentation from various jsdoc comments in your code and markdown files. Examples for each file and their location described below.
/*** Render a name component.** > **Note:** Parsed with markdown!** @order 1*/
Order: Set priority of component on the page.
@api is the main form of documentation. Any other properties or methods will be ignored.
/*** The path data rendered in the SVG.** @type* @default 'Hello World'*/@api foo = 'Hello World';
Namespace Markdown File (recommended)
Introducing your namespace is a great way explain the relationship between the components.
# Override `namespace`This namespace contains components to help with your app.[icon]: M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z[order]: 1
Icon: Icon is an optional single pathed SVG file. Use any icon from MaterialDesignIcons.com. Defaults to
Order: For multiple namespaces set a priority.
Component Markdown File (optional)
By default the JSdoc description above the component class will be used. To not clutter the JS file one can used a markdown file to override the
# Override Component TitleOverride the JSdoc description. Ideal for teams that do not want to clutter their files.[order]: 1
Examples are great way to explain what
@api in your component will do. Including one example for every
@api is recommended.
JSdoc at the top of your
WithFoo class will be used.
/*** This example sets the foo attribute.** @order 1*/
Order: Set example order. Useful for showing basic examples first.
You can override anything in the JSdoc with a markdown file the
Want to show off your components tests. Test counts if found will show to the right of the header. Clicking will navigate the user to your GitHub repo's spec file.
Similar to tests it is highly encouraged to provide integration testing. These will appear to the right in the header if found.
Themes are managed through several dynamic components.