AhaSlides Design
v0.52.0React · Vue · Lit

Components · Data Entry

Rate

Capture or display a score as a row of stars.

Examples

Half-step
Count
Character
Disabled
Interactive · click or hover to rate
3 / 5
States · value 3 (probe) · half-step 3.5 · custom heart character · readonly · disabled

API

PropTypeDefaultNotes
valuenumber0Current score (0…count; .5 steps with allow-half)
countnumber5Number of stars (DS V3 name; `max` is an alias)
allow-halfbooleanfalseHalf-star selection — the left half of a star scores n−0.5
allow-clearbooleanfalseClick the current value again to clear to 0
iconstringCustom character: a DS icon name (e.g. system-heart-straight) drawn instead of the star
readonlybooleanfalseDisplay only — no interaction
disabledbooleanfalseDims and disables the control
changeCustomEvent<{value}>Composed event; read e.detail.value

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-rate';   // registers <aha-rate>

Agent feed for this component (absolute, fetchable anywhere): rate.agent.json · rate.md · rate.llms.txt

When to use

When to use
  • Rate — a subjective score on a small fixed scale — a review, a difficulty, satisfaction
  • Segmented — picking one labelled option from a few, not a magnitude
  • Slider — a continuous value across a wide range
Keep the scale small (5 is the norm). Pair with a short label — 'Rate this session' — and show the chosen value nearby for confirmation.
Surfaces
editor dashboard audience

Spec

Star 24×24, gap 4 · Filled yellow-50 #FFE32C · Empty gray-40 #E3E3E3 · Half filled overlay clipped to 50% (allow-half) · Character any DS icon by name via `icon` (outline, brand-tinted) · Hover scale 1.12, fill preview to cursor (half-precise)