Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@jchristou/star-rating-web-component
Advanced tools
A star rating component built using web component technology making it usable with any front end framework or library.
This package is available from npm. The package can be installed using
npm install @jchristou/star-rating-web-component
See the example project. This uses the npm
published version of the component.
To include the default styling you import the SASS file
import '@jchristou/star-rating-web-component/dist-component/StarRating.scss';
You can choose not to use the provided styles and provide your own or you can also override the provided styles. An example of this is shown in the example project by examining style.scss.
The component listens for the window resize event and checks whether its container width has changed. If the container width has changed then it resizes the stars and spacing to fit the new width. This makes the component responsive.
This component uses the Custom Element API as well as HTML Templates from the Web Components specification. Older browsers such as IE11 do not natively support this and so you will need to install the @webcomponents/webcomponentsjs
polyfill package (this is done in the example project) to support these browsers. The component has been tested down to IE11 using this polyfill.
Run npm install
to install all packages and depenedencies.
To run dev server with HMR while developing use npm run start
. This will run the project on http://localhost:8080 by default.
In order to build for pushing to npm
you need to run npm run build:component
. This will build the required package files into the dist-component
folder. Running npm publish
will then publish this to npm
.
FAQs
Star Rating Web Component
The npm package @jchristou/star-rating-web-component receives a total of 1 weekly downloads. As such, @jchristou/star-rating-web-component popularity was classified as not popular.
We found that @jchristou/star-rating-web-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.