Skip to main content

Heading: React

Headings are meant to structurally denote important regions and provide a clear hierarchy in pages.

Installation

Before you can start using the @mediahuis/chameleon-react component, you’ll need to install it, for more information check: Getting started for developers.

With that done, you’re now ready to implement the component in your application.

import { Heading } from '@mediahuis/chameleon-react';

export default function Example() {
return <Heading>Example heading</Heading>;
}

Properties

PropertyTypeDefaultRequiredDescription
asElementType-NoAllows changing the rendered HTML tag (e.g., span, p, h1).
childrenReactNode-YesThe content for the Heading component.
classNameString-NoAllows extending the class names of the Heading component.
colorChameleonCssToken-NoAllows changing the color of the component through the use of a CSS Custom Property. (e.g. 'var(--color-primary-base)')
level1 | 2 | 3 | 4 | 5 | 62NoChanges the Heading's level.
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'display''xl'NoChanges the Heading's visual size.