@atlaskit/heading
Version:
A heading is a typography component used to display text in different sizes and formats.
31 lines (30 loc) • 969 B
TypeScript
import React, { type ReactNode } from 'react';
import type { HeadingLevel } from './types';
interface HeadingLevelContextProps {
/**
* Optional - only apply this value if the intent is to reset the heading context outside the normal content flow, for example inside a `section`.
*/
value?: HeadingLevel;
/**
* Semantic hierarchy of content below the heading context.
*/
children: ReactNode;
}
/**
* __Heading level provider__
*
* The Heading level provider injects the heading level to all `Heading` components below it in the component tree.
*
* @example
* ```tsx
* // Will correctly infer the heading level
* <HeadingContext value={1}>
* <Heading>H1</Heading>
* <HeadingContext>
* <Heading>H2</Heading>
* </HeadingContext>
* </HeadingContext>
* ```
*/
declare const HeadingLevelContextProvider: ({ children, value, }: HeadingLevelContextProps) => React.JSX.Element;
export default HeadingLevelContextProvider;