Heading
A heading is a typography component used to display text in different sizes and formats.Installation
| Install | yarn add @atlaskit/heading |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/heading, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
Heading props
| Description | Allows the component to be rendered as the specified HTML element, overriding a default element set by the |
|---|---|
| Type | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span" |
| Description | The text of the heading. |
|---|---|
| Type | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
| Description | Token representing text color with a built-in fallback value.
Will apply inverse text color automatically if placed within a Box with bold background color.
Defaults to |
|---|---|
| Type | "color.text" | "color.text.inverse" | "color.text.warning.inverse" |
| Description | Unique identifier for the heading HTML element. |
|---|---|
| Type | string |
| Description | Allows getting a ref to the component instance.
Once the component unmounts, React will set @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|---|---|
| Type | string | Ref<HTMLHeadingElement> |
| Description | Determines which text styles are applied. A corresponding HTML element is automatically applied from h1 to h6 based on the size.
This can be overriden using the |
|---|---|
| Type | "xxlarge" | "xlarge" | "large" | "medium" | "small" | "xsmall" | "xxsmall" |
| Description | A |
|---|---|
| Type | string |
Heading context provider props
| Description | Semantic hierarchy of content below the heading context. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | Optional - only apply this value if the intent is to reset the heading context outside the normal content flow, for example inside a |
|---|---|
| Type | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |