Component docs
Loading
import { MarkdownHeading } from "@pixxl-tools/components";
// In Server Components:
import { MarkdownHeading } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
as | HeadingElement | h2 | Heading level. |
anchor | boolean | true | Make the heading its own #id permalink, with a # mark on hover (default true when id is set). |
size | HeadingSize | — | Visual size (default from MARKDOWN_HEADING_SIZES: h1 lg, h2 md, h3 sm, h4–h6 xs — one step below the page title). |
asdefault h2HeadingElement
Heading level.
anchordefault trueboolean
Make the heading its own #id permalink, with a # mark on hover (default true when id is set).
sizeHeadingSize
Visual size (default from MARKDOWN_HEADING_SIZES: h1 lg, h2 md, h3 sm, h4–h6 xs — one step below the page title).
Other props are passed to the root element (HTMLAttributes<HTMLHeadingElement>), including className, style, id and aria-* attributes.
import ReactMarkdown from "react-markdown";
import { MarkdownHeading, MarkdownProse, markdownComponents } from "@pixxl-tools/components";
const source = "Set **size** and **tone** on any control.";
<MarkdownHeading as="h2" id="options">Options</MarkdownHeading>
<MarkdownProse>
<ReactMarkdown components={markdownComponents}>{source}</ReactMarkdown>
</MarkdownProse>