react-starred

    1.4.4 • Public • Published

    React Starred


    📝 Table of Contents

    🧐 About

    This component directly provides you the Stars rating component with all the options/settings you need.

    Prerequisites

    This module is meant to be used in react projects.

    Installing

    install this module using the following command in your project directory:

    npm i -S react-starred@latest
    

    🎈 Usage

    one the module is installed in the project, import the module into the file you want to use with the following command:

    import Stars from 'react-starred';
    

    once imported, you can use the Stars component with the following syntax:

    <Stars given={3} on={5} updateGiven={yourMethodToUpdateGivenStarsValue} />
    

    The best way to use this component is as follows:

    const App = () => {
        const [given, updateGiven] = useState(3);
        useEffect(() => {
            console.log(given); /* you will get the updated given stars count here */
        });
        return (
            <div>
                <Stars given={given} on={10} updateGiven={updateGiven} />
            </div>
        );
    };
    
    render(<App />, document.getElementById("app"));
    

    Demo

    click here to view demo.

    ⛏️ Built Using

    ✍️ Authors

    • @ovpv - Idea & Initial work

    Install

    npm i react-starred

    DownloadsWeekly Downloads

    10

    Version

    1.4.4

    License

    none

    Unpacked Size

    190 kB

    Total Files

    8

    Last publish

    Collaborators

    • ovpv