Typography
A collection of responsive typography components built for shadcn/ui, featuring headings (H1-H6), paragraphs, blockquotes, and specialized text variants (Lead, Large, Small, Muted, Code). Each component supports responsive sizing, custom styling through className props, and optional rendering through Radix UI's Slot primitive for flexible composition.
Benefit
These components are highly useful as they allow you to define and style your typography at once and reuse it consistently throughout your entire project. This approach promotes design consistency and maintainability. Additionally, you can further customize the styles to suit your specific needs.
How To Use
Preview
Heading 1 - The Quick Brown Fox
Heading 2 - Jumps Over The Lazy Dog
Heading 3 - Pack My Box With Five Dozen Liquor Jugs
Heading 4 - The Five Boxing Wizards Jump Quickly
Heading 5 - How Vexingly Quick Daft Zebras Jump
Heading 6 - The Quick Onyx Goblin Jumps
This is a regular paragraph with some text. It demonstrates the base typography style. The paragraph includes proper line height and spacing that adjusts responsively.
This is a block quote that showcases how quotations look. It includes proper styling with a left border and italic text that adjusts based on screen size.
Here is some text with a code snippet
embedded within it. Below are different text variations:
Accepted Props
These components accept all the standard props relevant to their corresponding HTML elements—for example, H1
accepts props for an <h1>
, H2 for an <h2>
, P
for a <p>
, and Code for a <code>
element. Additionally, they support the asChild
prop, allowing you to apply the respective styling without rendering the actual HTML tag. This is useful when you want the styling of a h1 without wrapping your content in an <h1>
element.