Generate Customizable Badges Using JavaScript And SVG – Squire.js

Category: Javascript , Recommended | November 11, 2018
Author: IagoLast
Views Total: 919
Official Page: Go to website
Last Update: November 11, 2018
License: MIT

Preview:

Generate Customizable Badges Using JavaScript And SVG – Squire.js

Description:

Squire.js is a JavaScript library to generate consistent, customizable, vector-shaped badges using SVG and JavaScript.

Compatible with both browser and node.js.

How to use it:

Load the compiled squire.js library in the document.

<script src="/dist/squire.js"></script>

Generate a basic badge with the generateBadge API.

squire.generateBadge('Left Text', 'Right Text', 'Hex Color Here');

Generate a highly customizable badge with the generateBadgeSVG API.

squire.generateBadgeSVG({
  borderRadius: 4,
  fontSize: 9,
  height: 20,
  subject: 'Left Text'
  subjectColor: 'BG color'
  subjectLengt: 'Length'
  subjectTextColor: '#FFF',
  value: 'Right Text'
  valueColor: 'BG color'
  valueLength: 'Length'
  valueTextColor: '#FFF',
  width: 100
})

You Might Be Interested In:


Leave a Reply