Socket
Socket
Sign inDemoInstall

@jchristou/star-rating-web-component

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jchristou/star-rating-web-component

Star rating web component


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Star Rating Web Component

A star rating component built using web component technology making it usable with any front end framework or library.

Features

  • Display star ratings
  • Cross browser support down to IE11 (with webcomponents polyfill)
  • Web component based and works with React, Angular and server side HTML
  • Very simple interface and open for style overrides

Installation

This package is available from npm. The package can be installed using

npm install @jchristou/star-rating-web-component

Usage

See the example project. This uses the npm published version of the component.

Default Styling

To include the default styling you can import it as a SASS file

import '@jchristou/star-rating-web-component/dist-component/StarRating.scss';

or as a compiled CSS file

import '@jchristou/star-rating-web-component/dist-component/StarRating.css';

Override Styling

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.

Browser Support

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.

Development

Run npm install to install all packages and depenedencies.

Dev

To run dev server with HMR while developing use npm run start. This will run the project on http://localhost:8080 by default.

Production Package Build

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.

Keywords

FAQs

Package last updated on 23 May 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc