import { Heading } from '@mediahuis/chameleon-react'
< Heading > An important title </ Heading >
Props Name Type Default Required Description as Function String Node Object - - Change the rendered HTML tag e.g. span, p, h1 children Node - true Content for component *required className String - - Extend classNames. color String - - Changes the Heading's color, choose one of the tokens. decoration 'inherit' 'none' 'underline' 'line-through' 'none' - Sets the css text-decoration property. fontFamily 'inherit' 'primary' 'secondary' 'system' 'system' - Sets the css font-family property. fontStyle 'inherit' 'normal' 'italic' 'oblique' - - Sets the css font-style property. fontWeight 'inherit' 'regular' 'medium' 'bold' - - Sets the css font-weight property. level 1 2 3 4 5 6 1 - Maps token scale to font-size, line-height & font-weight textAlign 'inherit' 'left' 'right' 'center' 'justify' 'inherit' - Sets the css text-align property. textTransform 'inherit' 'none' 'capitalize' 'uppercase' 'lowercase' - - Sets the css text-transform property.
System Props flexProps alignSelf, flex, flexBasis, flexGrow, flexShrink, order
marginProps m, mb, ml, mr, mt, mx, my
textProps fontWeight, fontStyle, textAlign, fontFamily, decoration, textTransform
System Props Next to the properties listed in the propstable, a collection of system props can be added to any component for further general styling and layouting purposes. These props vary per component.
To read more about the system, click here to check out its dedicated page .
Color default: colorBlackBase
To change the text color.
A colorized title A colorized title < Heading color = " primaryBase " > A colorized title </ Heading >
< Heading color = " colorPrimaryBase " > A colorized title </ Heading >
Decoration default: none
Controls the text-decoration css attribute.
A title with underline A title with line-through < Heading decoration = " underline " > A title with underline </ Heading >
< Heading decoration = " line-through " > A title with line - through </ Heading >
FontFamily default: system
Font-families can be used to discern between multiple uses of a Heading.
A primary title A secondary title A system title < Heading fontFamily = " primary " > A primary title </ Heading >
< Heading fontFamily = " secondary " > A secondary title </ Heading >
< Heading fontFamily = " system " > A system title </ Heading >
FontWeight default: undefined
Controls the font-weight css attribute. Only 3 values are available. If a value
is missing, it will fallback on the more bold weight.
< Heading fontWeight = " inherit " > inherit </ Heading >
< Heading fontWeight = " regular " > regular </ Heading >
< Heading fontWeight = " medium " > medium </ Heading >
< Heading fontWeight = " bold " > bold </ Heading >
Level default: 1
To change the font-size and the html-tag.
Note: Heading 1, 2, 3, 4, 5 and 6 have responsive behaviour.
Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 < Heading level = { 1 } > Level 1 </ Heading >
< Heading level = { 2 } > Level 2 </ Heading >
< Heading level = { 3 } > Level 3 </ Heading >
< Heading level = { 4 } > Level 4 </ Heading >
< Heading level = { 5 } > Level 5 </ Heading >
< Heading level = { 6 } > Level 6 </ Heading >
TextAlign default: inherit
Controls the css text-align attribute.
inherit left right center justify < Heading textAlign = " inherit " > inherit </ Heading >
< Heading textAlign = " left " > left </ Heading >
< Heading textAlign = " right " > right </ Heading >
< Heading textAlign = " center " > center </ Heading >
< Heading textAlign = " justify " > justify </ Heading >