Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

starify

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starify

A lightweight, customizable, and accessible React library for creating elegant star rating systems.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Starify

npm version build status license

Starify is a lightweight, customizable, and accessible React library for creating elegant star rating systems. Perfect for product reviews, blog comments, or any rating widget.


Features

  • Customizable: Adjust star size, colors, and symbols.
  • 🎯 Accessible: Fully keyboard and screen-reader compatible.
  • 🚀 Lightweight: Optimized for fast integration.
  • 🌟 Responsive: Scales beautifully across all devices.

Installation

Install Starify via npm:

npm install starify

Usage

Basic Example:

import { Star, StarRatingProvider } from "starify";

const App = () => (
  <StarRatingProvider totalStars={5}>
    <div>
      {[...Array(5)].map((_, index) => (
        <Star key={index} star={index + 1} size="2em" />
      ))}
    </div>
  </StarRatingProvider>
);

export default App;

API Documentation

Star Component Props

PropTypeDefaultDescription
starNumber-The star number in the sequence.
sizeString'1em'Font size for the star symbol.
filledColorString'gold'Color of filled stars.
unfilledColorString'gray'Color of unfilled stars.
symbolString'★'Symbol for stars.

StarRatingProvider Props

PropTypeDefaultDescription
totalStarsNumber5Total number of stars in the rating system.
childrenNode-React components wrapped by the provider.

Accessibility

Starify is designed with accessibility in mind:

  • Includes ARIA roles for screen readers.
  • Supports keyboard navigation with ArrowLeft, ArrowRight, and Enter.

Testing

Run tests and check coverage:

npm test -- --coverage

Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix:
    git checkout -b feature/my-feature
    
  3. Commit your changes:
    git commit -m "Add my feature"
    
  4. Push to your branch:
    git push origin feature/my-feature
    
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

FAQs

Package last updated on 21 Nov 2024

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