Layouts used for positioning content inside of pages, cards, or containers.
<%= pb_rails("layout", props: {position: "left", size: "sm", collapse: "md"}) do %> <%= pb_rails("layout/sidebar") do %> <%= pb_rails("body", props: { text: "Light" }) %> <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %> <br/><br/> <%= pb_rails("layout", props: {position: "left", size: "sm", collapse: "md", variant: "dark"}) do %> <%= pb_rails("layout/sidebar") do %> <%= pb_rails("body", props: { text: "Dark", dark: true }) %> <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %> <br/><br/> <%= pb_rails("layout", props: {position: "left", size: "sm", collapse: "md", variant: "gradient"}) do %> <%= pb_rails("layout/sidebar") do %> <%= pb_rails("body", props: { text: "Gradient", dark: true }) %> <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %>
<%= pb_rails("layout", props: {position: "left", size: "xs", collapse: "sm", transparent: true}) do %> <%= pb_rails("layout/sidebar") do %> <%= pb_rails("body", props: { text: "Side" }) %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("body", props: { text: "Body" }) %> <% end %> <% end %>
<%= pb_rails("layout", props: {position: "left", size: "xs", collapse: "xs"}) do %> <%= pb_rails("layout/sidebar") do %> Side <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %> <br/><br/> <%= pb_rails("layout", props: {position: "left", size: "sm", collapse: "sm"}) do %> <%= pb_rails("layout/sidebar") do %> Side <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %> <br/><br/> <%= pb_rails("layout", props: {position: "left", size: "md", collapse: "sm"}) do %> <%= pb_rails("layout/sidebar") do %> Side <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %> <br/><br/> <%= pb_rails("layout", props: {position: "left", size: "lg", collapse: "sm"}) do %> <%= pb_rails("layout/sidebar") do %> Side <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %> <br/><br/> <%= pb_rails("layout", props: {position: "left", size: "xl", collapse: "sm"}) do %> <%= pb_rails("layout/sidebar") do %> Side <% end %> <%= pb_rails("layout/body") do %> Body <% end %> <% end %>
Layout can leverage the max-width property. Learn more in our visual guidelines.
<%= pb_rails("layout", props: {layout: "collection"}) do %> <%= pb_rails("layout/body") do %> <%= pb_rails("card" ) do %> Card content <% end %> <%= pb_rails("card") do %> <%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %> <%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3 }) %> <% end %> <%= pb_rails("card" ) do %> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "vertical", align: "center", size: "lg", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> <% end %> <%= pb_rails("card" ) do %> <%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %> <%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2 }) %> <%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1 }) %> <% end %> <%= pb_rails("card" ) do %> Card content <% end %> <%= pb_rails("card") do %> Card content <% end %> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "vertical", align: "center", size: "lg", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> <%= pb_rails("card" ) do %> Card content <% end %> <%= pb_rails("card" ) do %> <%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %> <%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3 }) %> <%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2 }) %> <%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1 }) %> <% end %> <% end %> <% end %>
The left element on Collection Detail can be used for things such as navigation or secondary content to the element on the right. The right content can be used the same way that you would use Collection. The element on the right should be the primary focus and can be used for repeating elements such as cards.
<%= pb_rails("layout", props: {position: "left", size: "sm", collapse: "md", layout: "collection_detail" }) do %> <%= pb_rails("layout/sidebar") do %> <%= pb_rails("card", props: { margin_right: "md", padding: "none" }) do %> <%= pb_rails("nav", props: {title: "Menu", link: "#", padding_top:"md" }) do %> <%= pb_rails("nav/item", props: { text: "Photos", link: "#" }) %> <%= pb_rails("nav/item", props: { text: "Music", link: "#" }) %> <%= pb_rails("nav/item", props: { text: "Video", link: "#", active: true }) %> <%= pb_rails("nav/item", props: { text: "Files", link: "#" }) %> <% end %> <% end %> <% end %> <%= pb_rails("layout/body") do %> <% 25.times do %> <%= pb_rails("card") do %> Card content <% end %> <% end %> <% end %> <% end %>
<%= pb_rails("layout", props: {layout: "kanban"}) do %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'Queued'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'In Progress'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'Validation'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'Done'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'OKRs'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'Bugs'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'Another Column'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'Another Column'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("caption", props: {text: 'A Final Column'}) %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <%= pb_rails("card") do %> Kanban Item <% end %> <% end %> <% end %>
<%= pb_rails("layout", props: {layout: "content" }) do %> <%= pb_rails("layout/header") do %> <%= pb_rails("card") do %> Header <% end %> <% end %> <%= pb_rails("layout/sidebar") do %> <%= pb_rails("card") do %> Sidebar <br><br> 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. <% end %> <% end %> <%= pb_rails("layout/body") do %> <%= pb_rails("card") do %> Body <br><br> 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 %> <% end %> <%= pb_rails("layout/footer") do %> <%= pb_rails("card") do %> Footer <% end %> <% end %> <% end %>
<%= pb_rails("layout", props: {layout: "masonry"}) do %> <%= pb_rails("layout/body") do %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://unsplash.it/500/400/?image=634" }) %> <% end %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1611932084285-4fc50bfb7102?ixid=MXwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxMnx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item", props: { size: "md" }) do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1611934529218-748707e1d066?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2307&q=80" }) %> <% end %> <%= pb_rails("layout/item", props: { size: "md" }) do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1611927263897-c2f1156bc760?ixid=MXwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwyMHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item", props: { size: "lg"}) do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1606851685679-2a35cfdd62d6?ixid=MXwxMjA3fDF8MHxlZGl0b3JpYWwtZmVlZHwxMXx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item", props: { size: "md" }) do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1612144349227-1555ef8f2467?ixid=MXwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwzM3x8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://unsplash.it/500/400/?image=634" }) %> <% end %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1611932084285-4fc50bfb7102?ixid=MXwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxMnx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item", props: { size: "md" }) do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1611934529218-748707e1d066?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2307&q=80" }) %> <% end %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://unsplash.it/500/400/?image=634" }) %> <% end %> <%= pb_rails("layout/item", props: { size: "md" }) do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1606851685679-2a35cfdd62d6?ixid=MXwxMjA3fDF8MHxlZGl0b3JpYWwtZmVlZHwxMXx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1612123912968-5f6e964e8ea5?ixid=MXwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw0N3x8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://images.unsplash.com/photo-1612092172331-d788286028d5?ixid=MXwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw3Mnx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" }) %> <% end %> <%= pb_rails("layout/item") do %> <%= pb_rails("image", props: { url: "https://unsplash.it/500/400/?image=634" }) %> <% end %> <% end %> <% 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%
|
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
|
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 |
---|---|---|---|
position |
enum
|
left
right
|
left
|
collapse |
enum
|
xs
sm
md
lg
xl
|
xs
|
full |
boolean
|
false
|
|
size |
enum
|
xs
sm
md
lg
xl
|
md
|
transparent |
boolean
|
false
|
|
variant |
enum
|
light
dark
gradient
|
light
|
layout |
enum
|
sidebar
collection
collection_detail
kanban
content
masonry
|
sidebar
|
responsive |
boolean
|
false
|