FINDING YOUR DIRECTION

0%

UI components / Inputs

Star Rating: a React and Tailwind UI component

Hover previews the rating, a click sets it with a pop, and arrow keys work too.

Star Rating component preview

Open the live Star Rating preview.

About inputs components

Form controls decide whether people finish a sign-up or give up. These components keep native elements underneath, so labels, keyboard input, autofill and validation keep working, and the animation only adds feedback.

Install the Star Rating

  1. Create components/ui/star-rating.tsx in your React + Tailwind project.
  2. Paste the code. It only imports React; keyframes are defined inside the file.
  3. Import the named component where you need it. The default export is a ready-made demo you can delete.

Frequently asked questions

Is the Star Rating component free?

Anyone can open the live preview. Copying the code is included with a Scrollhaus plan.

What do I need to use it?

A React project with Tailwind CSS: Next.js, Vite, Lovable or Bolt. The file only imports React; its animations ship inside the component.

Is it accessible?

It uses native elements and ARIA attributes where needed, keeps keyboard focus visible and works without a mouse.

More inputs

Browse all 49 UI components · Compare with 21st.dev