Rate
Import
import { VKRate } from "@vivakits/react-components";
Star
The number of stars can be specified by the star
prop. Defaults to 5.
Allow Clear
The allowClear
prop specifies whether to allow clear when clicked again. Defaults to true
.
Allow Half
The allowHalf
prop specifies whether to allow semi selection. Defaults to true
.
Disabled
The disabled
prop specifies whether the rate is read-only and unable to interact. Defaults to false
.
onChange
The onChange
prop specifies the callback when the select value changes.
Value
The value
prop specifies the current value.
defaultValue
The defaultValue
prop specifies the default value. Defaults to 4.
Character
The character
prop specifies the custom character of the rate. Defaults to ★
.
className
The className
prop specifies the custom class name of the rate.
filledColor
The filledColor
prop specifies the custom color when filled. Defaults to yellow
.
emptyColor
The emptyColor
prop specifies the custom color when empty. Defaults to gray
.
API Reference
Attribute | Type | Description | Default |
---|---|---|---|
star | number | Star couunt | 5 |
allowClear | boolean | Whether to allow clear when click again | true |
allowHalf | boolean | Whether to allow semi selection | true |
disabled | boolean | If read only, unable to interact | false |
onChange | function | Callback when select value | - |
value | number | The current value | - |
defaultValue | number | The default value | 4 |
character | ReactNode | The custom character of rate | ★ |
className | string | The custom class name of rate | - |
filledColor | string | Custom color when filled | yellow |
emptyColor | string | Custom color when empty | gray |