A standard heading component. Headings have no margins by default and can be sized independently of the underlying html element.
npm install @nib-components/heading
import Heading from '@nib-components/heading';
Dynamic heading sizing
|number or object||The heading size. Can be made responsive by passing an object of breakpoints. Value(s) must be one of |
|string or Component||The heading component. What DOM element should your heading be. Optional if |
|string||The heading color. Use one of the color selectors from Theme.|
The Heading component should be used for all heading elements and headings should be sentence case only.
There should only ever be one
h1 used on a page.
Be sure not to exceed 70 characters and avoid using hyphens (
-) to line wrap text.
Headings have no margins by default. If you wish to add margins please do so using the approved spacing package styled-components-spacing.
There are times when you may want to include a certain
h level, but for the underlying DOM element to have a specific size. For this, our Heading component supports mixing styling and heading levels through the
This is especially important for ensuring that pages follow a logical, semantic heading hierarchy.
Responsive heading size is possible by supplying an object of breakpoints to the
size prop, and specifying the underlying DOM element via the
If longer text is required, consider using the Copy component instead.