@beck24/example-code-component

A web component for show usage examples of other components

Usage no npm install needed!

<script type="module">
  import beck24ExampleCodeComponent from 'https://cdn.skypack.dev/@beck24/example-code-component';
</script>

README

Built With Stencil

Example Code Component

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/

Installation

Via script

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/

Via NPM

Install the module

npm install @beck24/example-code-component