Card can leverage the max-width property. Learn more in our visual guidelines.
Add a background color by passing the color name to background. List of all colors can be viewed here under Product Colors and Status: Subtle Variations.
<%= pb_rails("title", props: { text: "Card Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("card", props: { background: "dark", dark: true, margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Dark", dark: true }) %> <% end %> <%= pb_rails("card", props: { margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "White / Default" }) %> <% end %> <%= pb_rails("card", props: { background: "light", margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Light", dark: false }) %> <% end %> <%= pb_rails("title", props: { text: "Product Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("card", props: { background: "product_1_background", dark: true, margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Product 1 Background", dark: true }) %> <% end %> <%= pb_rails("card", props: { background: "product_7_highlight", margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Product 7 Highlight", dark: true }) %> <% end %> <%= pb_rails("card", props: { background: "product_2_background", margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Product 2 Highlight", dark: true }) %> <% end %> <%= pb_rails("title", props: { text: "Subtle Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("card", props: { background: "success_subtle", margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Success Subtle" }) %> <% end %> <%= pb_rails("card", props: { background: "warning_subtle", margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Warning Subtle" }) %> <% end %> <%= pb_rails("card", props: { background: "info_subtle", margin_bottom: "sm" }) do %> <%= pb_rails("body", props: { text: "Info Subtle" }) %> <% end %>
Card highlight can pass status, product, and category colors. List of all colors can be viewed here.
<%= pb_rails("card", props: {highlight: {position: "side", color:"product_6_highlight"}, margin_bottom: "sm"}) do %> Side Position & Product 6 Highlight Color <% end %> <%= pb_rails("card", props: {highlight: {position: "top", color:"warning"}, margin_bottom: "sm"}) do %> Top Position & Warning Color <% end %> <%= pb_rails("card", props: {highlight: {position: "side", color:"category_2"}, margin_bottom: "sm"}) do %> Side Position & Category 2 Color <% end %>
Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed here.
<%= pb_rails("title", props: { text: "Category Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %> <%= pb_rails("card/card_header", props: { padding: "sm" }) do %> <%= pb_rails("body", props: { text: "Category 1", dark: true }) %> <% end %> <%= pb_rails("card/card_body", props: { padding: "md" }) do %> Category 1 <% end %> <% end %> <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %> <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "category_3" }) do %> <%= pb_rails("body", props: { text: "Category 3", dark: false }) %> <% end %> <%= pb_rails("card/card_body", props: { padding: "md", }) do %> Body <% end %> <% end %> <%= pb_rails("title", props: { text: "Product Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %> <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "product_2_background" }) do %> <%= pb_rails("body", props: { text: "Product 2 Background", dark: true }) %> <% end %> <%= pb_rails("card/card_body", props: { padding: "md" }) do %> Body <% end %> <% end %> <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %> <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "product_6_background" }) do %> <%= pb_rails("body", props: { text: "Product 6 Background", dark: true }) %> <% end %> <%= pb_rails("card/card_body", props: { padding: "md" }) do %> Body <% end %> <% end %> <%= pb_rails("title", props: { text: "Background Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %> <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "white" }) do %> <%= pb_rails("body", props: { text: "White", dark: false }) %> <% end %> <%= pb_rails("card/card_body", props: { padding: "md" }) do %> Body <% end %> <% end %> <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %> <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "bg_dark" }) do %> <%= pb_rails("body", props: { text: "Dark", dark: true }) %> <% end %> <%= pb_rails("card/card_body", props: { padding: "md" }) do %> Body <% end %> <% end %> <%= pb_rails("title", props: { text: "Striped Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %> <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "category_1", header_color_striped: true }) do %> <%= pb_rails("body", props: { text: "Striped Category 1", dark: true }) %> <% end %> <%= pb_rails("card/card_body", props: { padding: "md", }) do %> Body <% end %> <% end %>
<%= pb_rails("card", props: { tag: "section" }) do %> section <% end %> <br /> <%= pb_rails("card", props: { tag: "footer" }) do %> footer <% end %> <br /> <%= pb_rails("card", props: { tag: "header" }) do %> header <% end %> <br /> <%= pb_rails("card", props: { tag: "article" }) do %> article <% end %> <br /> <%= pb_rails("card", props: { tag: "aside" }) do %> aside <% end %> <br /> <%= pb_rails("card", props: { tag: "main" }) do %> main <% end %> <br /> <%= pb_rails("card", props: { tag: "nav" }) do %> nav <% end %>
<%= pb_rails("card", props: {padding: "none"}) do %> Card content <% end %> <br> <%= pb_rails("card", props: {padding: "xs"}) do %> Card content <% end %> <br> <%= pb_rails("card", props: {padding: "md"}) do %> Card content <% end %> <br> <%= pb_rails("card", props: {padding: "lg"}) do %> Card content <% end %> <br> <%= pb_rails("card", props: {padding: "xl"}) do %> Card content <% end %>
<%= pb_rails("card", props: {shadow: "none"}) do %> Card content <% end %> <br> <%= pb_rails("card", props: {shadow: "deep"}) do %> Card content <% end %> <br> <%= pb_rails("card", props: {shadow: "deeper"}) do %> Card content <% end %> <br> <%= pb_rails("card", props: {shadow: "deepest"}) do %> Card content <% end %>
<%= pb_rails("card", props: { cursor: "pointer" }) do %> Card Content <% end %> <br> <%= pb_rails("card") do %> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at. <br><br> Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa. <% end %>
<%= pb_rails("card", props: { padding: "none" }) do %> <%= pb_rails("card/card_body", props: { padding: "sm" }) do %> Header <% end %> <%= pb_rails("section_separator") %> <%= pb_rails("card/card_body", props: { padding: "sm" }) do %> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at. Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa. <% end %> <%= pb_rails("section_separator") %> <%= pb_rails("card/card_body", props: { padding: "sm" }) do %> Footer <% end %> <% end %>
Remove card border only for dashboard cards.
border_radius_md
is the card kit default
<%= pb_rails("card", props: { border_radius: "rounded" }) do %> Rounded (1000px) <% end %> <br> <%= pb_rails("card", props: { border_radius: "xl" }) do %> Extra large (16px) <% end %> <br> <%= pb_rails("card", props: { border_radius: "lg" }) do %> Large (8px) <% end %> <br> <%= pb_rails("card", props: { border_radius: "md" }) do %> Medium (6px) <% end %> <br> <%= pb_rails("card", props: { border_radius: "sm" }) do %> Small (4px) <% end %> <br> <%= pb_rails("card", props: { border_radius: "xs" }) do %> Extra small (4px) <% end %> <br> <%= pb_rails("card", props: { border_radius: "none" }) do %> None <% end %>
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%
|
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
|
|
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
|
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
|
|
height |
string
|
|
min_height |
string
|
|
max_height |
string
|
Props | Type | Values | Default |
---|---|---|---|
border_radius |
enum
|
xs
sm
md
lg
xl
none
rounded
|
md
|
selected |
boolean
|
false
|
|
highlight |
hashprop
|
||
tag |
enum
|
div
section
footer
header
article
aside
main
nav
|
div
|
border_none |
boolean
|
false
|
|
background |
enum
|
white
light
dark
product_1_background
product_1_highlight
product_2_background
product_2_highlight
product_3_background
product_3_highlight
product_4_background
product_4_highlight
product_5_background
product_5_highlight
product_6_background
product_6_highlight
product_7_background
product_7_highlight
product_8_background
product_8_highlight
product_9_background
product_9_highlight
product_10_background
product_10_highlight
windows
siding
doors
solar
roofing
gutters
insulation
none
success_subtle
warning_subtle
error_subtle
info_subtle
neutral_subtle
|
none
|