0.7.1 • Published 3 years ago
@slice-and-dice/govuk-react-caption v0.7.1
Caption
Import
import Caption from '@govuk-react/caption';
Usage
Simple
<Caption>Caption heading text</Caption>
With another header
import { H1 } from '@govuk-react/heading';
<Caption size="XL">Supporting header text</Caption>
<H1>Main header text</H1>
References
- https://github.com/alphagov/govuk-frontend/blob/master/src/core/_typography.scss
- https://design-system.service.gov.uk/styles/typography/#headings
Properties
Prop | Required | Default | Type | Description |
---|---|---|---|---|
children | true | | string | Text to be rendered as a caption | ||
size | 'XL' | enum(...Object.keys(CAPTION_SIZES) | ...Object.keys(TYPOGRAPHY_SCALE)) | Visual size level, accepts: XLARGE , LARGE , MEDIUM , XL , L , M or a numeric size that fits in the GDS font scale list |
0.7.1
3 years ago