UNPKG

@atlaskit/heading

Version:

A heading is a typography component used to display text in different sizes and formats.

10 lines 391 B
import { useHeadingLevel } from './use-heading-level'; export var useHeading = function useHeading(fallback) { var hLevel = useHeadingLevel(); /** * Order here is important, we for now apply * 1. inferred a11y level (this only applies if context is present) * 2. default final fallback */ return [hLevel, hLevel && (hLevel > 6 ? 'div' : "h".concat(hLevel)) || fallback]; };