A light-weight and high-performance component to generate barcode for Svelte.
MIT License
A light-weight and high-performance component to generate barcode for Svelte.
svelte-barcode is available on npm. It can be installed with the following command:
npm install svelte-barcode --save
svelte-barcode is available on yarn as well. It can be installed with the following command:
yarn add svelte-barcode --save
Note: Install as a dev dependency ( npm install svelte-barcode -D
) ( yarn add svelte-barcode --dev
) if using Sapper to avoid a SSR error.
<script>
import Barcode from 'svelte-barcode';
</script>
<Barcode
value={'svelte-barcode'}
elementTag={'canvas'}
options={{
format: 'CODE128',
width: 2,
height: 100,
text: '',
textAlign: 'center',
textPosition: 'bottom',
textMargin: 2,
fontSize: 20,
background: '#ffffff',
lineColor: '#000000',
}}
/>
If you think any of the svelte-barcode
can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.
We'd love to have your helping hand on contributions to svelte-barcode
by forking and sending a pull request!
Your contributions are heartily welcome, recognized and appreciated. ()
How to contribute:
The MIT License