Heading

January 27, 2026 ยท View on GitHub

Heading text structured in levels.

Usage

import { Heading, HeadingLevel, HeadingSize } from "@docspace/ui-kit/components/heading";
<Heading level={HeadingLevel.h1} size={HeadingSize.large} title="Some title">
  Some text
</Heading>

Custom element rendering

You can override the rendered element using the as prop:

<Heading level={HeadingLevel.h1} as="div">
  Rendered as div but styled as h1
</Heading>

Properties

Main Props

PropsTypeRequiredValuesDefaultDescription
levelHeadingLevel-h1, h2, h3, h4, h5, h6HeadingLevel.h1The heading level. It corresponds to the number after the 'H' for the DOM tag. Sets the level for semantic accuracy and accessibility.
sizeHeadingSize-xsmall, small, medium, large, xlargeHeadingSize.mediumSets the size of headline
typeHeadingType-header, menu, content-Sets the type of headline
childrenReact.ReactNode---Content of the heading

Style Props

PropsTypeRequiredDefaultDescription
colorstring--Specifies the headline color
fontSizestring--Sets the font size
fontWeightnumber | string--Sets the font weight
lineHeightstring--Sets the line height
isInlineboolean-falseSets the 'display: inline-block' property
truncateboolean-falseDisables word wrapping
classNamestring--Sets the class name
styleReact.CSSProperties--Additional inline styles

HTML Props

PropsTypeRequiredDefaultDescription
idstring--HTML id attribute
titlestring--Title attribute for hover tooltip
asReact.ElementType--Sets the tag through which the component is rendered

The component also supports all standard HTML attributes for heading elements and ARIA attributes.