logoNamu Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
1.0.0
  • Components Overview
  • General
    • Button
    • FloatButtonNew
    • Icon
    • Typography
  • Layout
    • Divider
    • Grid
    • Layout
    • Space
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPickerNew
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCodeNew
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • TourNew
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • AppNew
    • ConfigProvider
When To Use
Examples
Basic
Half star
Show copywriting
Read only
Clear star
Other Character
Customize character
API
Methods
Design Token

Rate

  • RadioSelect

    Resources

    Namu Design Charts
    Namu Design Pro
    Namu Design Pro Components
    Namu Design Mobile
    Namu Design Mini
    Namu Design Landing-Landing Templates
    Scaffolds-Scaffold Market
    Umi-React Application Framework
    dumi-Component doc generator
    qiankun-Micro-Frontends Framework
    ahooks-React Hooks Library
    Ant Motion-Motion Solution
    China Mirror 🇨🇳

    Community

    Awesome Namu Design
    Medium
    Twitter
    yuqueNamu Design in YuQue
    Namu Design in Zhihu
    Experience Cloud Blog
    seeconfSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTechMore Products

    yuqueYuQue-Document Collaboration Platform
    AntVAntV-Data Visualization
    EggEgg-Enterprise Node.js Framework
    kitchenKitchen-Sketch Toolkit
    xtechAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Namu Design Community

    Rate component.

    When To Use

    • Show evaluation.
    • A quick rating operation on something.

    Examples

    Basic

    The simplest usage.

    expand codeexpand code
    Show copywriting

    Add copywriting in rate components.

    expand codeexpand code
    Clear star

    Support set allow to clear star when click again.

    expand codeexpand code
    Customize character

    Can customize each character using (RateProps) => ReactNode.

    expand codeexpand code
    Half star

    Support select half star.

    expand codeexpand code
    Read only

    Read only, can't use mouse to interact.

    expand codeexpand code
    Other Character

    Replace the default star to other character like alphabet, digit, iconfont or even Chinese word.

    expand codeexpand code

    API

    Common props ref:Common props

    PropertyDescriptiontypeDefaultVersion
    allowClearWhether to allow clear when click againbooleantrue
    allowHalfWhether to allow semi selectionbooleanfalse
    autoFocusIf get focus when component mountedbooleanfalse
    characterThe custom character of rateReactNode | (RateProps) => ReactNode<StarFilled />function(): 4.4.0
    classNameThe custom class name of ratestring-
    countStar countnumber5
    defaultValueThe default valuenumber0
    disabledIf read only, unable to interactbooleanfalse
    styleThe custom style object of rateCSSProperties-
    tooltipsCustomize tooltip by each characterstring[]-
    valueThe current valuenumber-
    onBlurCallback when component lose focusfunction()-
    onChangeCallback when select valuefunction(value: number)-
    onFocusCallback when component get focusfunction()-
    onHoverChangeCallback when hover itemfunction(value: number)-
    onKeyDownCallback when keydown on componentfunction(event)-

    Methods

    NameDescription
    blur()Remove focus
    focus()Get focus

    Design Token

    Global Token

    normal
    allowClear: true
    allowClear: false
    • 1
      1
    • 2
      2
    • 3
      3
    • 4
      4
    • 5
      5


    • A
      A
    • A
      A
    • A
      A
    • A
      A
    • A
      A

    • 好
      好
    • 好
      好
    • 好
      好
    • 好
      好
    • 好
      好