A component to view other people’s opinions and experiences. Use when you want to show evaluation or a quick quantitative rating. Most effective when paired with reviews.
<%= pb_rails("star_rating", props: { padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 0.9, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 1.5, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 4.2, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 5, padding_bottom: "xs" }) %>
<%= pb_rails("star_rating", props: { rating: 3, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 2.8, layout_option: "number", padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, layout_option: "number", padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 1, layout_option: "onestar", padding_bottom: "xs" }) %>
<%= pb_rails("star_rating", props: { rating: 3, denominator: 3, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, denominator: 4, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, denominator: 6, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, denominator: 7, padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, denominator: 8, padding_bottom: "xs" }) %>
<%= pb_rails("star_rating", props: { rating: 3, size: "xs", padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, size: "sm", padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, size: "md", padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, size: "lg", padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, size: "lg", layout_option: "number", padding_bottom: "xs" }) %> <%= pb_rails("star_rating", props: { rating: 3, size: "lg", layout_option: "onestar", padding_bottom: "xs" }) %>
| Props | Type | Values |
|---|---|---|
align_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
align_items |
enum | responsive
|
start
end
center
|
border_radius |
enum
|
none
xs
sm
md
lg
xl
rounded
|
cursor |
enum
|
auto
default
none
contextMenu
help
pointer
progress
wait
cell
|
dark |
boolean
|
true
false
|
flex |
enum | responsive
|
auto
initial
0
1
2
3
4
5
6
7
8
9
10
11
12
none
|
flex_direction |
enum | responsive
|
row
column
rowReverse
columnReverse
|
flex_wrap |
enum | responsive
|
wrap
nowrap
wrapReverse
|
justify_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
line_height |
enum
|
loosest
looser
loose
normal
tight
tighter
tightest
|
margin_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin |
array
|
none
xxs
xs
sm
md
lg
xl
|
width |
string
|
|
min_width |
string
|
|
max_width |
string
|
|
gap |
string | responsive
|
|
column_gap |
string | responsive
|
|
row_gap |
string | responsive
|
|
number_spacing |
enum
|
tabular
|
order |
enum | responsive
|
none
first
1
2
3
4
5
6
7
8
9
10
11
12
|
overflow_x |
enum
|
scroll
visible
hidden
auto
|
overflow_y |
enum
|
scroll
visible
hidden
auto
|
overflow |
enum
|
scroll
visible
hidden
auto
|
padding_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding |
array
|
none
xxs
xs
sm
md
lg
xl
|
position |
enum
|
relative
absolute
fixed
sticky
static
|
shadow |
enum
|
none
deep
deeper
deepest
|
text_align |
enum | responsive
|
start
end
left
right
center
justify
justifyAll
matchParent
|
truncate |
enum
|
none
1
2
3
4
5
|
vertical_align |
enum | responsive
|
baseline
super
top
middle
bottom
sub
text-top
text-bottom
|
z_index |
enum | responsive
|
1
2
3
4
5
6
7
8
9
10
max
|
top |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
inset |
boolean
|
true
false
|
right |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
bottom |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
left |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
height |
string
|
|
max_height |
string
|
|
min_height |
string
|
|
hover |
object
|
|
group_hover |
boolean
|
true
false
|
| Props | Type | Values | Default |
|---|---|---|---|
fixed_width |
boolean
|
true
false
|
|
layout_option |
enum
|
default
number
onestar
|
default
|
icon |
string
|
||
label |
string
|
||
rating |
number
|
0
|
|
denominator |
number
|
5
|
|
color_option |
enum
|
yellow
primary
subtle
outline
|
yellow
|
background_type |
enum
|
fill
outline
|
fill
|
size |
enum
|
xs
sm
md
lg
|
sm
|
variant |
enum
|
display
interactive
|
display
|
on_click |
function
|
||
name |
string
|
||
required |
boolean
|
true
false
|
false
|
input_options |
string
|
||
default_value |
string
|