PHPackages                             kartik-v/bootstrap-star-rating - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kartik-v/bootstrap-star-rating

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kartik-v/bootstrap-star-rating
==============================

A simple yet powerful JQuery star rating plugin for Bootstrap.

v4.1.2(4y ago)1.1k4.5M—3.2%393[2 issues](https://github.com/kartik-v/bootstrap-star-rating/issues)5BSD-3-ClauseJavaScript

Since Apr 5Pushed 3y ago63 watchersCompare

[ Source](https://github.com/kartik-v/bootstrap-star-rating)[ Packagist](https://packagist.org/packages/kartik-v/bootstrap-star-rating)[ Docs](https://github.com/kartik-v/bootstrap-star-rating)[ Fund](https://opencollective.com/bootstrap-star-rating)[ RSS](/packages/kartik-v-bootstrap-star-rating/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (33)Used By (5)

 [ ![Krajee Logo](https://camo.githubusercontent.com/07c239a09021cd45af9443cbe1eb539cb7caf89140f593fb7f6a86891b0c32d5/68747470733a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](https://plugins.krajee.com "Krajee Plugins")
 bootstrap-star-rating ---

 [![Donate](https://camo.githubusercontent.com/0336bc43d88554a3f2d6c74dddf312bc2c65c2eacca70d83ae40f5567098d00e/68747470733a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal") [![kartikv](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67)](https://www.buymeacoffee.com/kartikv "Buy me a coffee")
===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------bootstrap-star-rating------------------)

[![Financial Contributors on Open Collective](https://camo.githubusercontent.com/8911a398415cfd4da5cdb79df5c0b93e983447a1903fdf675e455bcab9cc26b9/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f616c6c2f62616467652e7376673f6c6162656c3d66696e616e6369616c2b636f6e7472696275746f7273)](https://opencollective.com/bootstrap-star-rating)[![Bower version](https://camo.githubusercontent.com/2cc3dc1cf51a6ca0ea5dc8475f8a93fa12bf67bce5e3bdbe569d80e5078059d4/68747470733a2f2f62616467652e667572792e696f2f626f2f626f6f7473747261702d737461722d726174696e672e737667)](http://badge.fury.io/bo/bootstrap-star-rating)[![Latest Stable Version](https://camo.githubusercontent.com/278c1314504d99d8525a46eb38441c6eb4d3bf55764222c48e3f029266ff6b36/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f626f6f7473747261702d737461722d726174696e672f762f737461626c65)](https://packagist.org/packages/kartik-v/bootstrap-star-rating)[![License](https://camo.githubusercontent.com/0641a107db46af638ac481606a7e854a0f2c1f8ea4f887c5a3c8349180cef4f2/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f626f6f7473747261702d737461722d726174696e672f6c6963656e7365)](https://packagist.org/packages/kartik-v/bootstrap-star-rating)[![Packagist Downloads](https://camo.githubusercontent.com/72c9e39e92f28825ab81017347cee9a253839d4afd5c476ca9e7628c103d8381/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f626f6f7473747261702d737461722d726174696e672f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/bootstrap-star-rating)[![Monthly Downloads](https://camo.githubusercontent.com/057d26420eb19db7518346639277fa3ad40798cc07a1006589fb774e46571682/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f626f6f7473747261702d737461722d726174696e672f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/bootstrap-star-rating)

A simple yet powerful JQuery star rating plugin for Bootstrap which supports advanced features like fractional star fill and RTL input support. Developed with a focus on utlizing pure CSS-3 styling to render the control. The plugin uses Bootstrap markup and styling by default, but it can be overridden with any other CSS markup. View the [documentation](http://plugins.krajee.com/star-rating) or a [complete demo](http://plugins.krajee.com/star-rating/demo)at Krajee JQuery plugins.

> NOTE: Release v4.0 is a modified rewrite with various new enhancements and BC breaking features. It allows rendering richer markup for star symbols and offers theming support.

[![Star Rating Screenshot](https://camo.githubusercontent.com/5f1341e66d9b777810b5ed8a1ccfe29cf7e1b7218b35731bf4064f04180bddf0/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6b617274696b2d762f626f6f7473747261702d66696c65696e7075742d73616d706c657340302e302e312f73616d706c65732f737461722d726174696e672d73637265656e73686f742e706e67)](https://camo.githubusercontent.com/5f1341e66d9b777810b5ed8a1ccfe29cf7e1b7218b35731bf4064f04180bddf0/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f6b617274696b2d762f626f6f7473747261702d66696c65696e7075742d73616d706c657340302e302e312f73616d706c65732f737461722d726174696e672d73637265656e73686f742e706e67)

Features
--------

[](#features)

- Convert any HTML input to a star rating control.
- The plugin automatically converts an input to a star rating control if you set its `class = rating`. All options to the input can be passed as HTML5 `data` attributes.
- You can use the HTML 5 number input for polyfill and the plugin will automatically use the number attributes like `min`, `max`, and `step`. However, number inputs have a problem with decimal values on the Chrome Browser. Read the Browser Support section in the documentation.
- Involves pure CSS3 styling of the stars. Say goodbye to image sprites or playing with image backgrounds. Offers clean scalable vector icons for consistent display across devices. Optionally one can use the Unicode character set to override symbols.
- Use any of your favorite font icon frameworks to render your star symbols (for example you can easily use the icons from the FontAwesome library).
- Render and display fractional star ratings. Configure number of stars, min, max, step, and theoretically support any fractional rating.
- Uses Bootstrap 5.x, 4.x, 3.x styles &amp; Bootstrap 3.x glyphicons by default. But this can be overridden with plugin parameters and your own CSS styles.
- Support for RIGHT TO LEFT (RTL) input. Automatically changes star styling for RTL.
- Ability to clear values and options for the stars. Control where the clear button element can be shown.
- Reset star rating to the initial value when the form is reset.
- Ability to control and display caption of the selected stars. Each rated star can have its own caption. Control where the caption element can be shown.
- Ability to size the rating control including the stars, caption, and clear button. Five prebuilt size templates are available `xl`, `lg`, `md`, `sm`, and `xs`.
- Triggers JQuery events for advanced development. Events currently available are `rating.change`, `rating.clear`, `rating.reset`, `rating.refresh`, `rating.hover`, and `rating.hoverleave`.
- Disabled and readonly input star rating support.
- Change stars and caption on mouse hover (new feature since v3.0.0).
- Change stars and caption on slide and drag for mobile/touch devices (new feature since v3.1.0).
- Support for translations and locales.

### New features/changes since release v4.0

[](#new-featureschanges-since-release-v40)

- **BC Breaking Change**: The `symbol`, `glyphicon`, `ratingClass` properties have been removed. The functionality is replaced with the `theme` property (and can also be complemented or implemented separately using the `containerClass` property).
- New property `theme` will assign a CSS class with the `rating-` to the rating container.
    - Themes included
        - `krajee-svg` (for displaying svg icons) - default theme since v4.1.0
        - `krajee-uni` (for displaying Krajee unicode symbols as stars)
        - `krajee-fas` (for displaying font awesome 5.x icons)
        - `krajee-fa` (for displaying font awesome 4.x icons)
        - `krajee-gly` (for displaying bootstrap 3.x glyphicons)
    - Add ability to override and add one's own themes
- Stars now have a better padding and spacing that can be configured via CSS and themes
- New property `filledStar` - will allow one to set the markup for `filledStar` - will default to
    - ``
- New property `emptyStar` - will allow one to set the markup for `emptyStar` - will default to
    - ``
- Exclusive support for SVG (and a prebuilt `krajee-svg` theme that contains two different ready to use SVG icons).
- Ability to easily set the widget as a "display only" rating via `displayOnly` property.
- New property `animate` to control animation of highlighted stars on hover or click.

> NOTE: Refer [change log](https://github.com/kartik-v/bootstrap-star-rating/blob/master/CHANGE.md) for details on plugin enhancements, fixes, and changes.

Documentation and Demo
----------------------

[](#documentation-and-demo)

View the [plugin documentation](http://plugins.krajee.com/star-rating) and [plugin demos](http://plugins.krajee.com/star-rating/demo) at Krajee JQuery plugins.

Pre-requisites
--------------

[](#pre-requisites)

1. [Bootstrap 5.x, 4.x, 3.x](http://getbootstrap.com/)
2. Latest [JQuery](http://jquery.com/)
3. Most browsers supporting CSS3 &amp; JQuery.

Installation
------------

[](#installation)

### Using Bower

[](#using-bower)

You can use the `bower` package manager to install. Run:

```
bower install bootstrap-star-rating

```

### Using Composer

[](#using-composer)

You can use the `composer` package manager to install. Either run:

```
$ php composer.phar require kartik-v/bootstrap-star-rating "@dev"

```

or add:

```
"kartik-v/bootstrap-star-rating": "@dev"

```

to your composer.json file

> NOTE: You can use the [sass branch](https://github.com/kartik-v/bootstrap-star-rating/tree/sass) for installation using `bootstrap-sass` dependency. The [master branch](https://github.com/kartik-v/bootstrap-star-rating/tree/master) can be used for installation using plain `bootstrap` dependency.

### Manual Install

[](#manual-install)

You can also manually install the plugin easily to your project. Just download the source [ZIP](https://github.com/kartik-v/bootstrap-star-rating/zipball/master) or [TAR ball](https://github.com/kartik-v/bootstrap-star-rating/tarball/master) and extract the plugin assets (css and js folders) into your project.

Usage
-----

[](#usage)

Step 1: Load the following assets in your header.

```

```

If you noticed, you need to load the `jquery.min.js` and `bootstrap.min.css` in addition to the `star-rating.min.css` and `star-rating.min.js` for the plugin to work with default settings.

Step 2: Setup your input markup to automatically initialize the rating

```

```

Step 3: Initialize the plugin on your page for other input types. For example,

```
// initialize with defaults
$("#input-id").rating();

// with plugin options (do not attach the CSS class "rating" to your input if using this approach)
$("#input-id").rating({'size':'lg'});
```

The `#input-id` is the identifier for the input on your page (that you used to initialize the rating), and this input is hidden automatically by the plugin (by adding the bootstrap CSS class `hide`).

Alternatively, you can directly call the plugin options by setting data attributes to your input field.

Contributors
------------

[](#contributors)

### Code Contributors

[](#code-contributors)

This project exists thanks to all the people who contribute. \[[Contribute](CONTRIBUTING.md)\]. [![](https://camo.githubusercontent.com/0ba2dfdb3ee704b50485a30d77404cb77e0baa94ca6ed985cc6a304a1093ba65/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365)](https://github.com/kartik-v/bootstrap-star-rating/graphs/contributors)

### Financial Contributors

[](#financial-contributors)

Become a financial contributor and help us sustain our community. \[[Contribute](https://opencollective.com/bootstrap-star-rating/contribute)\]

#### Individuals

[](#individuals)

[![](https://camo.githubusercontent.com/232935053a826873bc072db7475984a5b93c1b1da9c59a96e0116fe6eda0dade/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f696e646976696475616c732e7376673f77696474683d383930)](https://opencollective.com/bootstrap-star-rating)

#### Organizations

[](#organizations)

Support this project with your organization. Your logo will show up here with a link to your website. \[[Contribute](https://opencollective.com/bootstrap-star-rating/contribute)\]

[![](https://camo.githubusercontent.com/d955219f8968532577bdc4a55b2a987e8ef00dcd1cd589285817a61eec88b4da/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f302f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/0/website)[![](https://camo.githubusercontent.com/d000294be3087f7b9f0e9a356b1e958888c5da90e55007aa9c5853a6f59640e5/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f312f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/1/website)[![](https://camo.githubusercontent.com/d12ca37659db4e0b4caa544dd6950dd95a59a68c564bc9de0aa37e577a337193/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f322f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/2/website)[![](https://camo.githubusercontent.com/107203b06d84845780baa9e566551fa4f41a42711377c86e947f09ae5c410f21/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f332f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/3/website)[![](https://camo.githubusercontent.com/686069d08f2825490acded6822d75fd55347b9e4f3349b579b81815c104d96c3/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f342f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/4/website)[![](https://camo.githubusercontent.com/468e9308bb00fc0364319e85a7f3388c22d0d8b8269a94c46c9a77b77f8cb1a3/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f352f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/5/website)[![](https://camo.githubusercontent.com/f669567bb12b2574b7d579391f4123427ca319ebc4669f80e52b96de7c06be2b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f362f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/6/website)[![](https://camo.githubusercontent.com/4e475fcf5b959f6ac621f0270a3f5c999dd2349d12dc2f469d011cc42f3766fe/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f372f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/7/website)[![](https://camo.githubusercontent.com/ae42e0b73bd6663a61eff03ec8015d0e5e10b87d8c42557a259975f86e2f7188/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f382f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/8/website)[![](https://camo.githubusercontent.com/a715123389c8e68c5dce2117669dd140bc1e7b433cb626a9da453f92ae118734/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f626f6f7473747261702d737461722d726174696e672f6f7267616e697a6174696f6e2f392f6176617461722e737667)](https://opencollective.com/bootstrap-star-rating/organization/9/website)

License
-------

[](#license)

**bootstrap-star-rating** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity69

Solid adoption and visibility

Community41

Growing community involvement

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 88.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Recently: every ~30 days

Total

31

Last Release

1702d ago

Major Versions

v1.2.0 → v2.0.02014-05-16

v2.6.0 → v3.0.02014-10-17

v3.5.8 → v4.0.02016-02-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (223 commits)")[![1vanguard](https://avatars.githubusercontent.com/u/15996352?v=4)](https://github.com/1vanguard "1vanguard (3 commits)")[![henriquebelfort](https://avatars.githubusercontent.com/u/5773877?v=4)](https://github.com/henriquebelfort "henriquebelfort (3 commits)")[![camerontucker](https://avatars.githubusercontent.com/u/11256231?v=4)](https://github.com/camerontucker "camerontucker (2 commits)")[![monkeywithacupcake](https://avatars.githubusercontent.com/u/7316730?v=4)](https://github.com/monkeywithacupcake "monkeywithacupcake (2 commits)")[![Bhoft](https://avatars.githubusercontent.com/u/1777147?v=4)](https://github.com/Bhoft "Bhoft (2 commits)")[![douglaspasqualin](https://avatars.githubusercontent.com/u/11462987?v=4)](https://github.com/douglaspasqualin "douglaspasqualin (1 commits)")[![eazlee](https://avatars.githubusercontent.com/u/39339965?v=4)](https://github.com/eazlee "eazlee (1 commits)")[![wowkin2](https://avatars.githubusercontent.com/u/1820114?v=4)](https://github.com/wowkin2 "wowkin2 (1 commits)")[![jamiehenson](https://avatars.githubusercontent.com/u/1105768?v=4)](https://github.com/jamiehenson "jamiehenson (1 commits)")[![jandosul](https://avatars.githubusercontent.com/u/388584?v=4)](https://github.com/jandosul "jandosul (1 commits)")[![azaiter](https://avatars.githubusercontent.com/u/17500365?v=4)](https://github.com/azaiter "azaiter (1 commits)")[![lsroudi](https://avatars.githubusercontent.com/u/5458930?v=4)](https://github.com/lsroudi "lsroudi (1 commits)")[![oguzkulcu](https://avatars.githubusercontent.com/u/19517048?v=4)](https://github.com/oguzkulcu "oguzkulcu (1 commits)")[![pkExec](https://avatars.githubusercontent.com/u/7925305?v=4)](https://github.com/pkExec "pkExec (1 commits)")[![primus852](https://avatars.githubusercontent.com/u/5185509?v=4)](https://github.com/primus852 "primus852 (1 commits)")[![russoalberto](https://avatars.githubusercontent.com/u/296379?v=4)](https://github.com/russoalberto "russoalberto (1 commits)")[![saeedsajadi](https://avatars.githubusercontent.com/u/3465334?v=4)](https://github.com/saeedsajadi "saeedsajadi (1 commits)")[![sandofvega](https://avatars.githubusercontent.com/u/34006175?v=4)](https://github.com/sandofvega "sandofvega (1 commits)")[![sergiubologa](https://avatars.githubusercontent.com/u/10432669?v=4)](https://github.com/sergiubologa "sergiubologa (1 commits)")

---

Tags

bootstrap-star-ratingcaptionchange-starscsscss-stylesfractionaljavascriptjqueryrate-controlratingrtlstarstar-symbolssvgbootstrapfontRatingawesomestarglyphicon

### Embed Badge

![Health badge](/badges/kartik-v-bootstrap-star-rating/health.svg)

```
[![Health](https://phpackages.com/badges/kartik-v-bootstrap-star-rating/health.svg)](https://phpackages.com/packages/kartik-v-bootstrap-star-rating)
```

###  Alternatives

[fortawesome/font-awesome

The iconic font, CSS, and SVG framework

76.5k7.3M126](/packages/fortawesome-font-awesome)[twbs/bootstrap-icons

Official open source SVG icon library for Bootstrap

7.9k2.0M56](/packages/twbs-bootstrap-icons)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[rmrevin/yii2-fontawesome

Asset Bundle for Yii2 with Font Awesome

1474.0M134](/packages/rmrevin-yii2-fontawesome)[blackknight467/star-rating-bundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

27198.0k](/packages/blackknight467-star-rating-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
