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: "right_side", color:"product_5_highlight"}, margin_bottom: "sm"}) do %> Right Side Position & Product 5 Highlight 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, status and background colors only. List of all category, product, status 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: "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("title", props: { text: "Status 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: "success" }) do %> <%= pb_rails("body", props: { text: "Success", 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: "error" }) do %> <%= pb_rails("body", props: { text: "Error", 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: "success_subtle" }) do %> <%= pb_rails("body", props: { text: "Success Subtle" }) %> <% 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: "error_subtle" }) do %> <%= pb_rails("body", props: { text: "Error Subtle"}) %> <% 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 |
|---|---|---|
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 |
|---|---|---|---|
background |
backgroundcolors | productcolors | "none"
|
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
|
border_none |
boolean
|
true
false
|
false
|
drag_id |
string
|
||
draggable_item |
boolean
|
true
false
|
false
|
drag_handle |
boolean
|
true
false
|
true
|
length |
number
|
||
selected |
boolean
|
true
false
|
false
|
tag |
enum
|
div
section
footer
header
article
aside
main
nav
|
div
|
header_color |
backgroundcolors | productcolors | categorycolors | statuscolors | "none"
|
category_1
|
|
header_color_striped |
boolean
|
true
false
|
false
|
highlight |
string
|
||
items |
array
|
||
drop_zone_line_color |
enum
|
primary
purple
|