UNPKG

@atlaskit/heading

Version:

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

16 lines (15 loc) 536 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useHeading = void 0; var _useHeadingLevel = require("./use-heading-level"); var useHeading = exports.useHeading = function useHeading(fallback) { var hLevel = (0, _useHeadingLevel.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]; };