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
| Prop | Type |
|---|---|
size | "s" | "m" | "l" | "xl" |
LabelComposite
| Prop | Type |
|---|---|
size | "s" | "m" | "l" | "xl" |
isPageHeadingWhether 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.