TidalUI

Rating input preview

Collect a bounded rating through native radios with exact form values.

pro · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/rating-input

Import components/ui/tidal.css, components/ui/rating-input.css. Wrap installed components in tidal-scope.

Preview

Rating input component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/rating-input.css";
import{TidalRatingInput}from"./components/ui/rating-input";
export default()=><div className="tidal-scope"><TidalRatingInput label={"Demo"} name={"Demo"} onValueChange={() => {}} value={1}/></div>;

API and props

TidalRatingInput.label (required)
ReactNode

Required label value accepted by this exported component.

TidalRatingInput.name (required)
string

Required name value accepted by this exported component.

TidalRatingInput.onValueChange (required)
(value: number | null, event: ChangeEvent<HTMLInputElement> | MouseEvent<HTMLButtonElement>) => void

Callback invoked when the value change interaction is proposed.

TidalRatingInput.value (required)
number | null

Required value value accepted by this exported component.

TidalRatingInput.clearButtonProps
Omit<Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "type" | "children" | "dangerouslySetInnerHTML"> | undefined

Optional clear button props value accepted by this exported component.

TidalRatingInput.clearButtonRef
Ref<HTMLButtonElement> | undefined

Optional clear button ref value accepted by this exported component.

TidalRatingInput.clearLabel
string | undefined

Optional clear label value accepted by this exported component.

TidalRatingInput.description
ReactNode

Optional description value accepted by this exported component.

TidalRatingInput.error
ReactNode

Optional error value accepted by this exported component.

TidalRatingInput.form
string | undefined

Optional form value accepted by this exported component.

TidalRatingInput.invalidLabel
ReactNode

Optional invalid label value accepted by this exported component.

TidalRatingInput.options
ReadonlyArray<TidalRatingOption> | undefined

Optional options value accepted by this exported component.

TidalRatingInput.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalRatingInput.required
boolean | undefined

Optional required value accepted by this exported component.

TidalRatingInput.showClear
boolean | undefined

Optional show clear value accepted by this exported component.

TidalRatingInput.unratedLabel
string | undefined

Optional unrated label value accepted by this exported component.

TidalRatingInput.valueLabel
((value: number) => ReactNode) | undefined

Optional value label value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas