Preview
The quick brown fox jumps over the lazy dog.
Installation
Usage
CSS Approach
If you want to style an entire block of HTML (like content from a CMS or Markdown), you can use the CSS-based approach.
- Copy the following CSS into your global stylesheet (e.g.,
globals.css):
- Add the
.fysk-typographyclass to the parent container of your content:
Examples
Default
Standard body and heading layout.
The Chronicles
Once upon a time...
Advanced Variants
Showcasing lists, blockquotes, and inline code.
Heading 2
Heading 3
Heading 4
Lead paragraph text.
Large text.
Small text.
- Item one
- Item two
- Item three
config.tsfile.Features
Semantic HTML: Dynamically switches the underlying HTML element (e.g.,
h1,p,blockquote,code) based on the selected variant.Responsive Sizing: Heading variants come with pre-configured fluid typography (e.g.,
h1transitions between sizes on mobile/desktop).Data Driven Lists: The `list` variant accepts a `data` array prop for cleaner JSX when rendering bullet points.
Consistent Spacing: Built-in margin handling for standard document flow (e.g., `:not(:first-child)` logic for paragraphs and headers).
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | string | "p" | Visual style and semantic mapping. |
as | ElementType | - | Manual override for the underlying HTML element. |
data | React.Node[] | - | Array of items to render when variant="list". |
Accepts all standard HTML attributes for the underlying element.