Rating
The Rating component is used to display a user's rating of a product, service, or business.
Components:
Rating
Type
Components
import
import { Rating } from '@pillar-ui/core'
Usage
import { Rating } from '@pillar-ui/core'
<Rating />
Examples
Title
import { Rating } from '@pillar-ui/core'
export const RatingTitle = () => {
return (
<>
<Rating rating={4} hideTitle />
<Rating rating={4} title="fake label" />
<Rating rating={4} />
</>
)
}
Rating
import { Rating } from '@pillar-ui/core'
export const RatingRating = () => {
return (
<>
<Rating rating={1} />
<Rating rating={2} />
<Rating rating={3} />
<Rating rating={4} />
<Rating rating={5} />
</>
)
}
Size
Default
4
Type
'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
import { Rating } from '@pillar-ui/core'
export const RatingSize = () => {
return (
<>
<Rating rating={4} size="1" />
<Rating rating={4} size="2" />
<Rating rating={4} size="3" />
<Rating rating={4} size="4" />
<Rating rating={4} size="5" />
<Rating rating={4} size="6" />
<Rating rating={4} size="7" />
<Rating rating={4} size="8" />
<Rating rating={4} size="9" />
</>
)
}
Color
Default
p
Type
'i' | 'd' | 'su' | 'se' | 'w' | 'p' | 'b' | 'o'
import { Rating } from '@pillar-ui/core'
export const RatingColor = () => {
return (
<>
<Rating color="d" rating={4} />
<Rating color="p" rating={4} />
<Rating color="se" rating={4} />
<Rating color="su" rating={4} />
<Rating color="w" rating={4} />
<Rating color="b" rating={4} />
<Rating color="i" rating={4} />
</>
)
}
Icon
import { Rating } from '@pillar-ui/core'
export const RatingIcon = () => {
return (
<>
<Rating icon="heart" rating={4} color="d" />
<Rating rating={4} />
</>
)
}