BaseRating

A score out of five, given or shown.

Import it from rei-kit: import { BaseRating } from 'rei-kit'

Open BaseRating in the live documentation, where every prop below is a control you can change, in four materials and ten palettes.

Usage

<script setup lang="ts">
import { ref } from 'vue'
import { BaseRating } from 'rei-kit'

const score = ref(4)
</script>

<template>
  <BaseRating
    v-model="score"
    label="Your rating"
    :value-label="(value, max) => `${value} out of ${max}`"
  />
</template>

Props

Props
PropTypeRequired or defaultWhat it is for
maxnumber5
labelstringyesWhat is being rated: "Difficulty", "Your rating". Already translated.
valueLabel(value: number, max: number) => stringyesThe spoken value: `(value, max) => \`${value} out of ${max}\`.`
readonlybooleanfalseShows a score rather than asks for one.
size'sm' | 'md' | 'lg''md'
allowClearbooleantruePressing the current score again clears it.

About rei-kit

rei-kit is an accessible Vue 3 and Tailwind CSS 4 component library: 106 components, themed by role rather than by colour on three independent axes — ten WCAG-checked palettes, four materials and light or dark, each switched with one attribute. Typed, tested, SSR-safe, no runtime dependencies, MIT.

pnpm add rei-kit · npm · GitHub