Use to provide supplementary context. Default size is best when providing supplementary context to a small section (i.e. label for a text input, label for a paragraph). Use large caption when supplementary text covers more content.
<%= pb_rails("caption", props: { text: "Caption" }) %> <%= pb_rails("caption", props: { text: "Caption Large", size: 'lg' }) %> <%= pb_rails("caption", props: { text: "Subcaption", size: 'xs' }) %>
<%= pb_rails("caption") do %> Block <% end %> <%= pb_rails("caption", props: { size: 'lg' }) do %> Large Block <% end %> <%= pb_rails("caption", props: { size: 'xs' }) do %> Subcaption Block <% 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
<%= pb_rails("caption", props: { text: "Test colors" }) %> <%= pb_rails("caption", props: { text: "Test colors", color: "success" }) %> <%= pb_rails("caption", props: { text: "Test colors", color: "error" }) %> <%= pb_rails("caption", props: { text: "Test colors", color: "link" }) %>
If the text gets very long when using default or large size, use a different typography style.