Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 LogoVuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

createRating API

API reference for the createRating composable.

Functions

createRating

(_options?: RatingOptions) => R

Creates a rating instance.

createRatingContext

(_options?: RatingContextOptions) => ContextTrinity<R>

Creates a rating context for dependency injection.

useRating

(namespace?: string) => R

Returns the current rating instance from context.

Options

value

number | ShallowRef<number> | undefined

Initial value or ref for v-model.

Default: 0

size

MaybeRefOrGetter<number> | undefined

Total items.

Default: 5

half

MaybeRefOrGetter<boolean> | undefined

Enable 0.5 step increments.

Default: false

Properties

value

WritableComputedRef<number, number>

Current rating, clamped to 0–size

size

number

Total items

half

boolean

Whether half-steps are enabled

items

ComputedRef<RatingItemDescriptor[]>

Array of items with computed state

isFirst

Readonly<Ref<boolean, boolean>>

Whether value is at minimum (0)

isLast

Readonly<Ref<boolean, boolean>>

Whether value is at maximum (size)

Methods

select

(value: number) => void

Set rating to specific value

next

() => void

Increment by step (1 or 0.5)

prev

() => void

Decrement by step (1 or 0.5)

first

() => void

Set to 0

last

() => void

Set to size

Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/