A web component for displaying example code. Has slots for display
where the active example will be demo'd, as well as html
, javascript
, and css
which will be in a tabbed component. Empty slots don't show tabs, so if only html
and javascript
is used there is no empty css
tab.
Comes with a <pretty-code> component for formatting code snippets
See the demo: https://beck24.github.io/example-code-component/
Include the script in the document head
<script src="https://unpkg.com/@beck24/example-code-component/dist/example-code.js"></script>
Use the component in the body
See the demo: https://beck24.github.io/example-code-component/
Install the module
npm install @beck24/example-code-component