Skip to main content
Components

Label

Import

import { Label, LabelComposite, LabelWrapper } from 'govuk-react/label';

Examples

Default

Code
<LabelComposite htmlFor="example">
  National Insurance number
</LabelComposite>

With input

Code
<>
  <LabelComposite {...args} />
  <Input id="example" name="example" />
</>

As page heading

Code
<LabelComposite
  htmlFor="example"
  size="l"
  isPageHeading
>
  National Insurance number
</LabelComposite>

API reference

Label

PropType
size"s" | "m" | "l" | "xl"

LabelComposite

PropType
size"s" | "m" | "l" | "xl"
isPageHeading

Whether the label also acts as the heading for the page.

boolean

LabelWrapper

No props of its own. Other props are passed to the element it renders.