This kit uses default
color by default, and can be replaced with colors below:
light
lighter
success
error
link
These colors are not for standard usage. You can use the color prop to make fixes if colors are not appearing properly, but consult your UX team members if you are deciding to implement it
<%= pb_rails("body", props: { text: "I am a body kit" }) %> <%= pb_rails("body", props: { text: "I am a body kit (Light)", color: "light" }) %> <%= pb_rails("body", props: { text: "I am a body kit (Lighter)", color: "lighter" }) %> <%= pb_rails("body", props: { text: "I am a body kit (Link)", color: "link" }) %> <%= pb_rails("body", props: { text: "I am a body kit (Error)", color: "error" }) %> <%= pb_rails("body", props: { text: "I am a body kit (Success)", color: "success" }) %>
Infuse your life with action. Don't wait for it to happen. Make it happen. Make your own future. Make your own hope. Make your own love. And whatever your beliefs, honor your creator, not by passively waiting for grace to come down from upon high, but by doing what you can to make grace happen... yourself, right now, right down here on Earth.
- Bradley Whitford
Using two global props can greatly improve the readability of articles and even forms. Set Max Width to md
, and Line Height to loose
.
<%= pb_rails("body", props: { line_height: "loose", max_width: "md" }) do %> <p>Infuse your life with action. Don't wait for it to happen. Make it happen. Make your own future. Make your own hope. Make your own love. And whatever your beliefs, honor your creator, not by passively waiting for grace to come down from upon high, but by doing what you can to make grace happen... yourself, right now, right down here on Earth.</p> <br /> <p>- Bradley Whitford</p> <% end %>
Playbook styles the b
, strong
, a
. i
, em
, small
and u
tags within the body kit to match Playbook's design system.
<%= pb_rails("body") do %> <b>This text is using the <%="<b>"%> tag</b> <br /> <br /> <strong>This text is using the <%="<strong>"%> tag</strong> <br /> <br /> <a href="#">This text is using the <%="<a>"%> tag</a> <br /> <br /> <i>This text is using an <%="<i>"%> tag</i> <br /> <br /> This <em>word</em> is using an <%="<em>"%> tag. <br /> <br /> <small>This text is using a <%="<small>"%> tag.</small> <br /> <br /> <u>This text is using a <%="<u>"%> tag.</u> <% end %>
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("body", props: { text: lorem, truncate: "1", margin_bottom: "md" }) %> <%= pb_rails("caption", props: { text: "After second row" }) %> <%= pb_rails("body", props: { text: lorem, truncate: "2", margin_bottom: "md" }) %> <%= pb_rails("caption", props: { text: "After third row" }) %> <%= pb_rails("body", props: { text: lorem, truncate: "3" }) %> <% end %>
Caption kit will use light
color by default. Other available colors are:
default
lighter
success
error
link
These colors are not for standard usage. You can use the color prop to make fixes if colors are not appearing properly, but consult your UX team members if you are deciding to implement it
This kit uses the light
color by default, and can be replaced with colors below:
default
lighter
link
error
success
These colors are not for standard usage. You can use the color
prop to make fixes if colors are not appearing properly, but consult your UX team members if you are deciding to implement it.
<%= pb_rails("detail", props: { text: "I am a detail kit", color: "default" }) %> <%= pb_rails("detail", props: { text: "I am a detail kit", color: "lighter" }) %> <%= pb_rails("detail", props: { text: "I am a detail kit", color: "link" }) %> <%= pb_rails("detail", props: { text: "I am a detail kit", color: "error" }) %> <%= pb_rails("detail", props: { text: "I am a detail kit", color: "success" }) %>
Use the bold
prop to strongly emphasis your text.
<%= pb_rails("detail", props: { bold: true, text: "I am a bold detail kit" }) %> <%= pb_rails("detail", props: { bold: true, color: "default", text: "I am a bold detail kit" }) %> <%= pb_rails("detail", props: { bold: true, color: "lighter", text: "I am a bold detail kit" }) %> <%= pb_rails("detail", props: { bold: true, color: "link", text: "I am a bold detail kit" }) %> <%= pb_rails("detail", props: { bold: true, color: "error", text: "I am a bold detail kit" }) %> <%= pb_rails("detail", props: { bold: true, color: "success", text: "I am a bold detail kit" }) %>
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: { }) do %> Default Title <% end %> <br/> <%= 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: "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 %>
<div> <%= pb_rails("link", props: { text: "link example", href: "https://www.google.com/search?q=playbook+design+system", }) %> </div> <div> <%= pb_rails("link", props: { text: "link example", href: "https://www.youtube.com/@PowerHRG", color: "body", }) %> </div> <div> <%= pb_rails("link", props: { text: "link example", href: "https://github.com/powerhome/.github/blob/main/profile/README.md", color: "muted", }) %> </div> <div> <%= pb_rails("link", props: { text: "link example", href: "https://rubygems.org/gems/playbook_ui/", color: "destructive", }) %> </div>
<%= pb_rails("link", props: { text: "h1 link example", href: "#tag", icon: "arrow-up-right-from-square", tag: "h1", }) %> <%= pb_rails("link", props: { text: "h3 link example", href: "#tag2", tag: "h3", underline: true, }) %> <%= pb_rails("link", props: { color: "destructive", text: "h6 link example", href: "#tag3", tag: "h6", }) %> <%= pb_rails("link", props: { text: "p link example", href: "#tag4", icon_right: "chevron-right", tag: "p", }) %> <div> This is a <%= pb_rails("link", props: { text: "span link example", href: "#tag5", tag: "span", }) %> </div>