• Docs
  • Blog
    • 0.24.0

    • Switch to dark mode
    Get Started
    Components
    Styling
    Theming

    Concepts

    OverviewCompositionTesting

    Layout

    Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrap

    Components

    AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

    Utilities

    Feature FlagsForLocal StoragePortalShowsplitPropsTheme

    Rating

    The Rating component provides a way to select a value from a range of values, typically used for feedback on a scale.

    • npm
    • source
    • recipe
    • Ark
    import { Rating, RatingParts } from '@cerberus/react'

    Usage

    The Rating component is an abstracted client component that provides a way to select a value from a range of values. It is used to provide feedback on a scale. The default count is 5, and the default value is 0.

    Readonly State

    To render the Rating component in a read-only state, you can use the readOnly prop.

    Orientation

    The Rating component supports two layout orientations for label usage: horizontal, and vertical. The default orientation is vertical.

    Sizes

    The Rating component supports two sizes: sm, and md. The default size is sm.

    Primitives

    You can utilize the primitive components or the css prop to customize the radio.

    ComponentDescription
    RatingRootThe context provider for the Rating parts
    RatingLabelThe label of the rating
    RatingControlThe visual control of the rating
    RatingContextThe context provider for the rating
    RatingItemThe container of the rating item
    RatingItemContextThe context provider for a rating item
    RatingHiddenInputThe native input for the rating

    API

    Props

    Rating

    The Rating component is an abstraction of the primitives and accepts the following props:

    NameDefaultDescription
    orientationhorizontalThis orientation of the group.
    paletteactionThe color palette of the items .
    sizesmThe size of the label.

    The Rating component also accepts all the props of the RatingRoot primitive props

    Parts

    The RatingParts API is an Object containing the full family of components.

    Note

    It is best to only use the RatingParts if you are building a custom solution. Importing Object based components will ship every property it includes into your bundle, regardless if you use it or not.

    NameDescription
    RootThe RatingRoot component which is the Provider for the family.
    LabelThe RatingLabel component which displays the label.
    ControlThe RatingControl component which displays the visual rating.
    ItemThe RatingItem component which is the container to a single item.
    ItemContextThe RatingItemContext component which is the context provider for a single item.
    HiddenInputThe RatingHiddenInput component which displays the native radio.

    On this page

    • Edit this page on Github
    Cerberus Design System | Docs