This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.
<div class="pb--doc-demo-row"> <div> <%= 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" }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "horizontal", align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", orientation: "horizontal", align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> <br> <%= pb_rails("user", props: { name: "Anna Black", orientation: "horizontal", align: "left", avatar: true }) %> </div> </div>
Name will use font-weight: 700 by default, if you want a lighter font weight, use the bold prop set to false. Name will then use font-weight: 300.
<div class="pb--doc-demo-row"> <div> <%= 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", bold: false }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "horizontal", align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", bold: false }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", orientation: "horizontal", align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", bold: false }) %> <br> <%= pb_rails("user", props: { name: "Anna Black", orientation: "horizontal", align: "left", avatar: true, bold: false }) %> </div> </div>
<div class="pb--doc-demo-row"> <div> <%= pb_rails("user", props: { name: "Anna Black", territory: "PHL", title: "Remodeling Consultant", orientation: "vertical", align: "center", size: "lg", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", territory: "PHL", title: "Remodeling Consultant", orientation: "horizontal", align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", territory: "PHL", title: "Remodeling Consultant", orientation: "horizontal", align: "center", size: "sm"}) %> <br> <%= pb_rails("user", props: { name: "Anna Black", territory: "PHL", title: "Remodeling Consultant", orientation: "horizontal", align: "center", size: "lg"}) %> </div> </div>
<div class="pb--doc-demo-row"> <div> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "horizontal", align: "center", size: "lg"}) %> </div> <div class=""> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "horizontal", align: "left"}) %> </div> </div>
<div class="pb--doc-demo-row"> <div> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "horizontal", align: "left", size: "sm", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "horizontal", align: "left", size: "md", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> </div> <div> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "horizontal", align: "left", size: "lg", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> </div> </div>
<%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "vertical", align: "center", size: "sm", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> <br><br> <%= pb_rails("user", props: { name: "Anna Black", title: "Remodeling Consultant", orientation: "vertical", align: "center", size: "md", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg" }) %> <br><br> <%= 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" }) %>
<div class="pb--doc-demo-row"> <%= pb_rails("user", props: { align: "center", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", name: "Anna Black", orientation: "vertical", size: "md", subtitle: "User ID: 12345", territory: "PHL", title: "Remodeling Consultant" }) %> <%= pb_rails("user", props: { align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", name: "Anna Black", orientation: "horizontal", size: "md", subtitle: "User ID: 12345", territory: "PHL", title: "Remodeling Consultant" }) %> </div>
The kit accepts block content and whatever is passed as block content will display in the subtitle section.
<div class="pb--doc-demo-row"> <%= pb_rails("user", props: { align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", name: "Anna Black", orientation: "horizontal", size: "md", territory: "PHL", title: "Remodeling Consultant" }) do %> <%= pb_rails("flex", props: { align: "center" }) do %> <%= pb_rails("icon", props: { icon: "users" }) %> <%= pb_rails("caption", props: { padding_left: "xs", text: "Admin" }) %> <% end %> <% end %> <%= pb_rails("user", props: { align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", name: "Anna Black", orientation: "horizontal", size: "md", }) do %> <%= pb_rails("contact", props: { contact_type: "cell", contact_value: "349-185-9988" }) %> <%= pb_rails("contact", props: { contact_value: 5555555555 }) %> <%= pb_rails("contact", props: { contact_type: "email", contact_value: "email@example.com" }) %> <% end %> </div>
Passing a name_style prop changes the type kit used for the user name. You can choose between title, body, caption, and detail. title is the default.
Passing a title_style prop changes the type kit used for the user title. You can choose between body, caption, and detail. body is the default.
The size of the caption is determined by the size prop.
<div class="pb--doc-demo-row"> <%= pb_rails("user", props: { align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", name: "Anna Black", name_style: "body", orientation: "horizontal", size: "md", territory: "PHL", title: "Remodeling Consultant" }) %> <%= pb_rails("user", props: { align: "left", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", name: "Anna Black", name_style: "detail", orientation: "horizontal", size: "md", territory: "PHL", title: "Remodeling Consultant" }) %> </div>
| 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 |
|---|---|---|---|
align |
enum
|
left
center
right
|
left
|
avatar |
boolean
|
true
false
|
false
|
avatar_url |
string
|
||
bold |
boolean
|
true
false
|
true
|
avatar_grayscale |
boolean
|
true
false
|
false
|
name |
string
|
||
name_style |
enum
|
title
body
caption
detail
|
title
|
orientation |
enum
|
horizontal
vertical
|
horizontal
|
size |
enum
|
sm
md
lg
|
sm
|
subtitle |
string | array<node> | node
|
||
territory |
string
|
||
title |
string
|
||
title_style |
enum
|
title
body
caption
detail
|
body
|