Modus UI

Glance Score

Web (React)

A rating row whose icons lift as you hover, with a mono label tip.

Unset marks sit in the border tone, filled marks take the primary colour and the tip prints in inverted ink.

Modus / Glance Score

Installation

CLI

npx @modus-ui/cli add glance-score

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/glance-score.tsx.
  3. Paste the code.

Usage

tsx
import { GlanceScore } from "@/components/ui/glance-score";

export default function Example() {
  return <GlanceScore />;
}

Props

PropTypeDefaultDescription
valueany--
defaultValuenumber0-
onChangeany--
onPreviewany--
countnumber5-
shapestring"star"-
iconany--
labelsany[]-
activeColorstring"hsl(var(--primary))"-
idleColorstring"hsl(var(--border))"-
tipColorstring"hsl(var(--foreground))"-
tipTextColorstring"hsl(var(--background))"-
sizenumber26-
liftnumber4-
magnifynumber1.25-
riseDurationnumber320-
popScalenumber1.3-
showTipbooleantrue-
allowClearbooleantrue-
readOnlybooleanfalse-
disabledbooleanfalse-
ariaLabelstring"Rating"-

Comments

  • No comments yet.