1.0.3 • Published 12 months ago

webbie-progress v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

webbie-progress NPM version NPM monthly downloads NPM total downloads

A web component to create simple progress and loading indicators. It can also be used to create simple avatar frames.


Install

Install with npm: npm install webbie-progress


Usage

Add script to page with <script type="module" src="node_modules/webbie-progress/dist/webbie-progress.js"></script>

<webbie-progress></webbie-progress>

Props

All props are optional, but you'd definitely need to use some to get anything more than a circle. The SVG viewbox is 100x100 and some props like radius and stroke-width are set relative to that.

NameDescription
verticesdecides the shape (frame) of the svg element (value: 3-20, circle for all other values)
sizeset the size of the square element
rotaterotate the svg frame clockwise in degrees (value: 0-360)
percentportion of the stroke path to be colored (value: 0-100)
textcontent for a centered <text> element
text-stylecustom css for the <text> element
imagesrc for an image that is clipped by the svg frame
radiusset the circumradius for the frame
stroke-widthset width for stroke
frame-widthset width for frame
stroke-colorset color for stroke
frame-colorset color for frame
fill-colorset background color within frame (won't work if image prop is used)
stroke-shadowset drop shadow color for stroke
stroke-anim-speedset animation speed for stroke movement along the frame (default: 0s)
frame-anim-speedset animation speed for frame rotation (default: 0s)
stroke-anim-reversereverse animation direction
frame-anim-reversereverse animation direction
stroke-styleset additional css style for stroke path
frame-styleset css for frame path

Further examples in demo.html

1.0.2

12 months ago

1.0.3

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago