UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

20 lines (19 loc) 1.12 kB
import type { ReactElement } from "react"; import { type AlignVariants } from "../style/Align.js"; import { type ColorVariants } from "../style/Color.js"; import { type SpacingVariants } from "../style/Spacing.js"; import { type TypographyVariants } from "../style/Typography.js"; import type { ChildProps } from "../util/props.js"; /** Props shared by `Title`, `Heading`, and `Subheading`. */ export interface HeadingProps extends AlignVariants, ColorVariants, SpacingVariants, TypographyVariants, ChildProps { /** * Heading level (`1`–`6`) — sets the rendered `<h1>`–`<h6>` tag. * Avoid overriding this in practice: pick the component that matches the level — `Title` (`<h1>`), `Heading` (`<h2>`), or `Subheading` (`<h3>`) — so the visual size and the document outline stay in step. */ level?: "1" | "2" | "3" | "4" | "5" | "6" | 1 | 2 | 3 | 4 | 5 | 6; } /** * Section heading — renders an `<h2>`. * - Sits between `Title` (`<h1>`) and `Subheading` (`<h3>`) in the heading hierarchy. */ export declare function Heading({ level, children, ...variants }: HeadingProps): ReactElement;