Web Components for Arduino and various electronic parts.
npm install @wokwi/elementsnpm and then import it into your code:
js
import '@wokwi/elements';
`
Alternatively, you can load the Wokwi Elements bundle from unpkg's CDN:
`html
`
Replace 0.48.3 with the latest version number. You can find a list of all the versions in the releases page.
Local development
To prepare for local development, clone this repo, and then install
the dependencies:
`
npm install
`
Then start storybook:
`
npm run storybook
`
This will open a local dev server at http://localhost:6006, where you
can interact with the elements and see your changes live, similar to
https://elements.wokwi.com.
Creating a new element
The easiest way to create a new element is to run the generator:
`
npm run new-element --name demo
`
This will generate a new element called demo. It will also
create a storybook file, so you will be able to see the new element
in storybook (see the "Local development" section above).
Note: updates the docstrings in the code will not be reflected
in Storybook's Docs tab unless you restart Storybook, or run the
following command manually and refresh the page:
`
npm run analyze-components
``