For Form Pills with longer text, the truncate global prop can be used to truncate the label within each Form Pill. See here for more information on the truncate global prop.
NOTE: For Rails Form Pills (not ones embedded within a React-rendered Typeahead or MultiLevelSelect), a unique id
is required to enable the Tooltip functionality displaying the text or tag section of the Form Pill.
<% names = [ { label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' }, { label: 'Isabella Anastasia Wellington', value: 'Isabella Anastasia Wellington' }, { label: 'Christopher Maximilian Harrington', value: 'Christopher Maximilian Harrington' }, { label: 'Elizabeth Seraphina Kensington', value: 'Elizabeth Seraphina Kensington' }, { label: 'Theodore Jonathan Abernathy', value: 'Theodore Jonathan Abernathy' }, ] %> <%= pb_rails("typeahead", props: { html_options: { style: { maxWidth: "240px" }}, id: "typeahead-form-pill", is_multi: true, options: names, label: "Truncation Within Typeahead", pills: true, truncate: 1, }) %> <%= pb_rails("caption", props: { text: "Form Pill Truncation" }) %> <%= pb_rails("card", props: { max_width: "xs" }) do %> <%= pb_rails("form_pill", props: { name: "Princess Amelia Mignonette Grimaldi Thermopolis Renaldo", avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", tabindex: 0, truncate: 1, id: "truncation-1" }) %> <%= pb_rails("form_pill", props: { icon: "badge-check", text: "icon and a very long tag to show truncation", tabindex: 0, truncate: 1, id: "truncation-2" }) %> <%= pb_rails("form_pill", props: { text: "form pill long tag no tooltip show truncation", tabindex: 0, truncate: 1, }) %> <% end %>
By default textTransform = "none"
. If there is a need to enforce lowercase
, please pass the textTransform = "lowercase
prop.
The Status, Data, and Product colors highlighted above can be passed to the color
prop. Primary is the default color. Form pills with a text tag, an avatar, or an icon with text tag can all receive the color
prop.
<%= pb_rails("title", props: { text: "Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %> <%= pb_rails("form_pill", props: { text: "Primary", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "neutral", text: "Neutral", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "success", text: "Success", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "warning", text: "Warning", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "error", text: "Error", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "info", text: "Info", tabindex: 0, }) %> <%= pb_rails("title", props: { text: "Data Colors", tag: "h4", size: 4, margin_bottom: "sm", margin_top: "md" }) %> <%= pb_rails("form_pill", props: { color: "data_1", text: "Data 1", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "data_2", text: "Data 2", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "data_3", text: "Data 3", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "data_4", text: "Data 4", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "data_5", text: "Data 5", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "data_6", text: "Data 6", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "data_7", text: "Data 7", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "data_8", text: "Data 8", tabindex: 0, }) %> <%= pb_rails("title", props: { text: "Product Colors", tag: "h4", size: 4, margin_bottom: "sm", margin_top: "md" }) %> <%= pb_rails("form_pill", props: { color: "windows", text: "Windows", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "siding", text: "Siding", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "roofing", text: "Roofing", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "doors", text: "Doors", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "gutters", text: "Gutters", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "solar", text: "Solar", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "insulation", text: "Insulation", tabindex: 0, }) %> <%= pb_rails("form_pill", props: { color: "accessories", text: "Accessories", tabindex: 0, }) %>
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
|
|
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 |
---|---|---|---|
avatar_url |
string
|
||
name |
string
|
||
text |
string
|
||
size |
string
|
||
text_transform |
enum
|
none
lowercase
|
none
|
color |
enum
|
primary
neutral
success
warning
error
info
data_1
data_2
data_3
data_4
data_5
data_6
data_7
data_8
windows
siding
roofing
doors
gutters
solar
insulation
accessories
|
primary
|
tabindex |
string
|
||
icon |
string
|