0.10.6 • Published 7 months ago

@govuk-react/heading v0.10.6

Weekly downloads
633
License
MIT
Repository
-
Last release
7 months ago

Heading

Import

  import Heading from '@govuk-react/heading';

Usage

Simple

import { Heading } from 'govuk-react'

<Heading>Heading text</Heading>

To pick different heading levels it is recommended to use the shortcut versions as that will pick the appropriate tag as well as set the appropriate corresponding font size.

Using shortcuts

import { H1, H2, H3, H4, H5, H6 } from 'govuk-react'

<H1>h1</H1>
<H2>h2</H2>
<H3>h3</H3>
<H4>h4</H4>
<H5>h5</H5>
<H6>h6</H6>

Differing sizes

<H6 size={80}>
  H6 with font size 80
</H6>
<Heading as="h2" size="SMALL">
  Heading as h2 with SMALL size
</Heading>
<H3 size="LARGE">H3 with LARGE size</H3>

Props pass through

<Heading onClick={() => { console.log('clicked'); }}>Click me</Heading>

References:

Properties

PropRequiredDefaultTypeDescription
asundefinedstringSemantic heading tag to use (e.g. 'h3')By default element used will be an 'h1'
levelundefinednumberSemantic heading level value between 1 and 6 (deprecated)
size'XLARGE'enum(...Object.keys(HEADING_SIZES) | ...Object.keys(TYPOGRAPHY_SCALE))Visual size level, accepts: XLARGE, LARGE, MEDIUM, SMALL, XL, L, M, S or a numeric size that fits in the GDS font scale list
0.10.6

7 months ago

0.10.5

1 year ago

0.10.4

2 years ago

0.10.2

2 years ago

0.10.3

2 years ago

0.10.1

2 years ago

0.10.0

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.6.0-rc.1

5 years ago

0.6.0-alpha.4

5 years ago