Typically used as headers. Follow semantic hierarchy — Title 1s should be followed by Title 2s followed by Title 3s and so on, without skipping any levels.
Tags can be changed using the tag prop. However, be sure follow markdown semantics (h1's are followed by h2's followed by h3's and so on).
Title kit will use h3 tag by default, and size 3 as well.
Size and tag props are not in correlation with each other, meaning any size can be used along with any tag.
<%= pb_rails("title", props: { margin_bottom: "md" }) do %> Default Title <% end %> <%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1 }) %> <%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2 }) %> <%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3 }) %> <%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %>
Title kit will use default color by default. Other available colors are:
*light lighter success error link
<%= pb_rails("title", props: { text: "Default Color", tag: "h1", size: 3 }) %> <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "light" }) %> <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "lighter" }) %> <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "link" }) %> <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "success" }) %> <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "error" }) %>
The size prop supports responsive sizes. To use them, pass an object to the size prop containing your size values relative to responsive break points (show code below). To test this here, resize your browser window to responsively change this Title's size.
truncate | Type: String | Values: "1" | "2" | "3" | "4" | "5"
The truncate prop truncates overflowing text up to a maximum of five rows and adds an ellipsis at the end.
<% lorem = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, minus. Nisi beatae voluptatum labore sequi. Nemo accusantium corrupti, reiciendis magnam tenetur perferendis esse pariatur voluptas eaque hic vel rem nihil quidem dolorum ex dolor, libero ullam placeat, sapiente eos. Cumque obcaecati dignissimos molestiae, minima quibusdam sint maxime libero accusantium animi quis quia maiores enim ipsum, esse, modi laudantium illum error!" %> <%= pb_rails("flex", props: { orientation: "column", max_width: "md" }) do %> <%= pb_rails("caption", props: { text: "After first row" }) %> <%= pb_rails("title", props: { text: lorem, truncate: "1", size: 4, margin_bottom: "md" }) %> <%= pb_rails("caption", props: { text: "After second row" }) %> <%= pb_rails("title", props: { text: lorem, truncate: "2", size: 4, margin_bottom: "md" }) %> <%= pb_rails("caption", props: { text: "After third row" }) %> <%= pb_rails("title", props: { text: lorem, truncate: "3", size: 4 }) %> <% end %>
Responsive sizes for large screens and tablets, perfect for digital signage.
<%= pb_rails("title", props: { text: "Display Size xs", tag: "h1", display_size: "xs" }) %> <%= pb_rails("title", props: { text: "Display Size sm", tag: "h1", display_size: "sm" }) %> <%= pb_rails("title", props: { text: "Display Size md", tag: "h1", display_size: "md" }) %> <%= pb_rails("title", props: { text: "Display Size lg", tag: "h1", display_size: "lg" }) %> <%= pb_rails("title", props: { text: "Display Size xl", tag: "h1", display_size: "xl" }) %> <%= pb_rails("title", props: { text: "Display Size xxl", tag: "h1", display_size: "xxl" }) %> <%= pb_rails("title", props: { text: "This is a size of display", tag: "h1", size: "display"}) %>
| 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 |
|---|---|---|---|
bold |
boolean
|
true
false
|
true
|
color |
enum
|
default
light
lighter
success
error
link
|
|
size |
sizetype | sizeresponsivetype
|
3
|
|
display_size |
enum
|
xs
sm
md
lg
xl
xxl
|
|
tag |
enum
|
h1
h2
h3
h4
h5
h6
div
span
|
h3
|
text |
string
|
||
variant |
enum
|
link
|