Skip to main content
Version: v1 (Current)

Rating

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

Rating​

import { Rating } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
modelValuenumber | undefined0Current rating value (v-model).
maxnumber | undefined5Number of stars to render.
readonlyboolean | undefinedfalseRender as a static, non-interactive display.
disabledboolean | undefinedfalseDisable interaction while keeping the interactive markup.
allowClearboolean | undefinedtrueClicking the currently selected star clears the value back to 0.
size"default" | "sm" | "lg" | undefined"default"Icon size preset.
labelstring | undefined"Rating"Accessible label for the radiogroup.

Events​

NameTypeRequired / defaultDescription
update:modelValue[payload: number]——

Slots​

NameTypeRequired / defaultDescription
icon{ filled: boolean; index: number; }——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import { Heart } from 'lucide-vue-next'
import { Rating } from '.'
{
render: (args) => ({
components: { Rating },
setup() {
const value = ref(3)
return { args, value }
},
template: `
<div class="space-y-2">
<Rating v-bind="args" v-model="value" />
<p class="text-sm text-muted-foreground">Value: {{ value }}</p>
</div>
`,
}),
}

Readonly​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import { Heart } from 'lucide-vue-next'
import { Rating } from '.'
{
render: () => ({
components: { Rating },
template: '<Rating :model-value="4" readonly />',
}),
}

MaxTen​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import { Heart } from 'lucide-vue-next'
import { Rating } from '.'
{
name: 'Max Ten',
render: () => ({
components: { Rating },
setup() {
const value = ref(7)
return { value }
},
template: '<Rating v-model="value" :max="10" />',
}),
}