Adding examples
To improve the documentation even more, you can add examples of how to use your components. An example component is just another component that displays how your component is used. The example will be displayed both live and with the source code for the example.
To include an example, the custom @exampleComponent
doc block decorator should be used together with the name of the component. There is no limit to the number of components you can include.
The example component in this case is very simple
It's recomended to either name all the examples in a similar fashion, or to place them in an examples/
folder or similar. This way, it's very easy to exclude them from the production build by excluding them in the Stencil configuration.
Last updated