CSS Emoji Feedback Rating

Five emoji faces for quick feedback, greyed out until one is picked, which then pops up in full color.

  • emoji
  • feedback
  • rating
  • satisfaction
  • radio
  • survey
HTML
<fieldset class="emoji-rate">
  <legend>How was your experience?</legend>
  <label><input type="radio" name="mood" value="1" aria-label="Terrible"><span aria-hidden="true">๐Ÿ˜ </span></label>
  <label><input type="radio" name="mood" value="2" aria-label="Bad"><span aria-hidden="true">๐Ÿ™</span></label>
  <label><input type="radio" name="mood" value="3" aria-label="Okay"><span aria-hidden="true">๐Ÿ˜</span></label>
  <label><input type="radio" name="mood" value="4" aria-label="Good" checked><span aria-hidden="true">๐Ÿ™‚</span></label>
  <label><input type="radio" name="mood" value="5" aria-label="Great"><span aria-hidden="true">๐Ÿ˜</span></label>
</fieldset>
CSS
.emoji-rate {
  margin: 0;
  padding: 16px 14px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  font-family: system-ui, sans-serif;
  text-align: center;
}

.emoji-rate legend {
  float: left;
  width: 100%;
  margin-bottom: 10px;
  padding: 0;
  color: #431407;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.emoji-rate label {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

.emoji-rate input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emoji-rate span {
  font-size: 26px;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.5;
  transition: transform 0.2s cubic-bezier(0.4, 1.6, 0.6, 1), filter 0.2s ease, opacity 0.2s ease;
}

.emoji-rate label:hover span {
  filter: grayscale(0.3);
  opacity: 0.9;
}

.emoji-rate input:checked + span {
  filter: none;
  opacity: 1;
  transform: scale(1.3);
}

.emoji-rate label:has(:checked) {
  background: #ffedd5;
}

.emoji-rate label:has(:focus-visible) {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .emoji-rate span {
    transition: none;
  }
}

About this CSS Emoji Feedback Rating

This CSS Emoji Feedback Rating is 70 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms, filters and CSS Grid. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

Customize it

The colors in this snippet. Search and replace them to match your brand:

  • #fff
  • #431407
  • #ffedd5
  • #ea580c

How to use this emoji feedback rating

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .emoji-rate class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

โ€œCopy for AIโ€ copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback