Skip to content

Rating


View Source 

Usage

css
@import "winduum/src/components/rating/index.css" layer(components);

Variants

  • default 
  • invalid 

Props

  • default 

Installation

Follow instructions for individual framework usage below

  • winduum 
  • winduum-vue 
  • winduum-react 

Examples

Basic

html
<div class="x-rating accent-warning">
    <input type="radio" name="rating" value="1" aria-label="Rate 1/5">
    <input type="radio" name="rating" value="2" aria-label="Rate 2/5">
    <input type="radio" name="rating" value="3" aria-label="Rate 3/5">
    <input type="radio" name="rating" value="4" aria-label="Rate 4/5">
    <input type="radio" name="rating" value="5" aria-label="Rate 5/5">
</div>
vue
<script setup lang="ts">
    import { Rating } from '@/components/rating'
</script>

<template>
    <Rating class="accent-warning">
        <input type="radio" name="rating" value="1" aria-label="Rate 1/5">
        <input type="radio" name="rating" value="2" aria-label="Rate 2/5">
        <input type="radio" name="rating" value="3" aria-label="Rate 3/5">
        <input type="radio" name="rating" value="4" aria-label="Rate 4/5">
        <input type="radio" name="rating" value="5" aria-label="Rate 5/5">
    </Rating>
</template>
jsx
import { Rating } from '@/components/rating'

export function Example() {
    return (
        <Rating class="accent-warning">
            <input type="radio" name="rating" value="1" aria-label="Rate 1/5" />
            <input type="radio" name="rating" value="2" aria-label="Rate 2/5" />
            <input type="radio" name="rating" value="3" aria-label="Rate 3/5" />
            <input type="radio" name="rating" value="4" aria-label="Rate 4/5" />
            <input type="radio" name="rating" value="5" aria-label="Rate 5/5" />
        </Rating>
    )
}

Released under the MIT License.