Cards for information/content that can be selected. There is design for unselected and selected states. Typically used as a form element.
Default Selectable Cards are multi select by default.
<div class="pb--doc-demo-row"> <%= pb_rails("selectable_card", props: { input_id: "selected_with_icon", name: "selected_with_icon", value: "selected_with_icon", checked: true, icon: true, }) do %> Selected, with icon <% end %> <%= pb_rails("selectable_card", props: { input_id: "selected_without_icon", name: "selected_without_icon", value: "selected_without_icon", checked: true, }) do %> Selected, without icon <% end %> <%= pb_rails("selectable_card", props: { input_id: "unselected", name: "unselected", value: "unselected", }) do %> Unselected <% end %> <%= pb_rails("selectable_card", props: { input_id: "disabled", name: "disabled", value: "disabled", disabled: true }) do %> Disabled <% end %> </div>
Single Select allows only one selectable card in the set to be selected.
<div class="pb--doc-demo-row"> <%= pb_rails("selectable_card", props: { input_id: "male", name: "gender", value: "male", multi: false }) do %> Male <% end %> <%= pb_rails("selectable_card", props: { input_id: "female", name: "gender", value: "female", multi: false }) do %> Female <% end %> <%= pb_rails("selectable_card", props: { input_id: "other", name: "gender", value: "other", multi: false }) do %> Other <% end %> </div>
Selectable Cards can pass text or block content.
<div class="pb--doc-demo-row"> <%= pb_rails("selectable_card", props: { input_id: "block", name: "block", value: "block", checked: true }) do %> <%= pb_rails("title", props: { text: "Block", size: 4 }) %> <%= pb_rails("body", props: { tag: "span"}) do %> This uses block <% end %> <% end %> <br><br> <%= pb_rails("selectable_card", props: { input_id: "tag", name: "tag", value: "tag", text: "This passes in text", checked: false }) %> </div>
<div class="pb--doc-demo-row"> <%= pb_rails("selectable_card", props: { text: "Selected With Options", input_id: "selected_with options", name: "selected_with options", value: "selected_with options", checked: true, input_options: { class: "input-class", name: "overwriting-name", value: "overwriting-value", } }) %> </div>
Selectable Cards can pass images with optional text.
<div class="pb--doc-demo-row"> <%= pb_rails("selectable_card", props: { input_id: "selectable-image-default", name: "selectable-image-default", value: "selectable-image-default", checked: true, icon: true }) do %> <%= pb_rails("image", props: { rounded: true, size: "xl",url: "https://unsplash.it/500/400/?image=634" }) %> <%= pb_rails("body", props: { tag: "span"}) do %> Add text here <% end %> <% end %> <%= pb_rails("selectable_card", props: { input_id: "selectable-image-xl", name: "selectable-image-xl", value: "selectable-image-xl", checked: false, icon: true }) do %> <%= pb_rails("image", props: { rounded: true, size: "xl", url: "https://unsplash.it/500/400/?image=634" }) %> <% end %> </div>
Selectable Cards can show an input indicating state.
<%= pb_rails("title", props: { size: 3, text: "What programming languages do you know?" }) %> <br /> <%= pb_rails("selectable_card", props: { checked: true, input_id: "ruby", name: "ruby", value: "ruby", variant: "display_input" }) do %> Ruby <% end %> <%= pb_rails("selectable_card", props: { checked: true, input_id: "javascript", name: "javascript", value: "javascript", variant: "display_input" }) do %> JavaScript <% end %> <%= pb_rails("selectable_card", props: { input_id: "typescript", name: "typescript", value: "typescript", variant: "display_input" }) do %> TypeScript <% end %> <%= pb_rails("selectable_card", props: { input_id: "swift", name: "swift", value: "swift", variant: "display_input" }) do %> Swift <% end %> <br /> <%= pb_rails("title", props: { size: 3, text: "How likely are you to recommend Playbook to a friend?" }) %> <br /> <%= pb_rails("selectable_card", props: { checked: true, input_id: "first_radio", multi: false, name: "radio_group", value: "first_radio", variant: "display_input" }) do %> 5 <% end %> <%= pb_rails("selectable_card", props: { input_id: "second_radio", multi: false, name: "radio_group", value: "second_radio", variant: "display_input" }) do %> 4 <% end %> <%= pb_rails("selectable_card", props: { input_id: "third_radio", multi: false, name: "radio_group", value: "third_radio", variant: "display_input" }) do %> 3 <% end %> <%= pb_rails("selectable_card", props: { input_id: "fourth_radio", multi: false, name: "radio_group", value: "fourth_radio", variant: "display_input" }) do %> 2 <% end %> <%= pb_rails("selectable_card", props: { input_id: "fifth_radio", multi: false, name: "radio_group", value: "fifth_radio", variant: "display_input" }) do %> 1 <% end %>
<%= pb_rails("title", props: { size: 3, text: "What sports do you like?" }) %> <br /> <%= pb_rails("selectable_card", props: { error: true, input_id: "football", name: "football", value: "football", variant: "display_input" }) do %> Football <% end %> <%= pb_rails("selectable_card", props: { error: true, input_id: "basketball", name: "basketball", value: "basketball", variant: "display_input" }) do %> Basketball <% end %> <%= pb_rails("selectable_card", props: { error: true, input_id: "baseball", name: "baseball", value: "baseball", variant: "display_input" }) do %> Baseball <% end %>
Do not use Forms, Charts & Graphs, Text Input, Textarea, etc inside of selectable card.
Props | Type | Values |
---|---|---|
max_width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
min_width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
width |
array
|
0%
xs
sm
md
lg
xl
xxl
0
none
100%
|
z_index |
array
|
1
2
3
4
5
6
7
8
9
10
|
number_spacing |
array
|
tabular
|
shadow |
array
|
none
deep
deeper
deepest
|
line_height |
array
|
tightest
tighter
tight
normal
loose
looser
loosest
|
display |
array
|
block
inline_block
inline
flex
inline_flex
none
|
cursor |
array
|
auto
default
none
contextMenu
help
pointer
progress
wait
cell
crosshair
text
verticalText
alias
copy
move
noDrop
notAllowed
grab
grabbing
eResize
nResize
neResize
nwResize
sResize
seResize
swResize
wResize
ewResize
nsResize
neswResize
nwseResize
colResize
rowResize
allScroll
zoomIn
zoomOut
|
flex_direction |
array
|
row
column
rowReverse
columnReverse
|
flex_wrap |
array
|
wrap
nowrap
wrapReverse
|
justify_content |
array
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
justify_self |
array
|
auto
start
end
center
stretch
|
align_items |
array
|
flexStart
flexEnd
start
end
center
baseline
stretch
|
align_content |
array
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
align_self |
array
|
auto
start
end
center
stretch
baseline
|
flex |
array
|
auto
initial
0
1
2
3
4
5
6
7
8
9
10
11
12
none
|
flex_grow |
array
|
1
0
|
flex_shrink |
array
|
1
0
|
order |
array
|
1
2
3
4
5
6
7
8
9
10
11
12
|
position |
array
|
relative
absolute
fixed
sticky
|
hover |
array
|
|
border_radius |
array
|
none
xs
sm
md
lg
xl
rounded
|
text_align |
array
|
start
end
left
right
center
justify
justify-all
match-parent
|
overflow |
array
|
visible
hidden
scroll
auto
|
truncate |
array
|
1
2
3
4
5
|
left |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
top |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
right |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
bottom |
array
|
0
xxs
xs
sm
md
lg
xl
auto
initial
inherit
|
vertical_align |
array
|
baseline
super
top
middle
bottom
sub
text-top
text-bottom
|
height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
min_height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
max_height |
array
|
auto
xs
sm
md
lg
xl
xxl
xxxl
|
overflow_x |
array
|
visible
hidden
scroll
auto
|
overflow_y |
array
|
visible
hidden
scroll
auto
|
margin |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_top |
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
|
padding |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_top |
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
|
classname |
string
|
|
dark |
boolean
|
|
group_hover |
boolean
|
|
id |
string
|
|
data |
hashprop
|
|
aria |
hashprop
|
|
html_options |
hashprop
|
|
children |
proc
|
|
style |
hashprop
|
Props | Type | Values | Default |
---|---|---|---|
checked |
boolean
|
false
|
|
disabled |
boolean
|
false
|
|
error |
boolean
|
false
|
|
icon |
boolean
|
false
|
|
multi |
boolean
|
true
|
|
input_id |
string
|
||
input_options |
hashprop
|
||
name |
string
|
||
text |
string
|
||
value |
string
|
||
variant |
string
|
default
|