@govuk-react/label

Styled label with children displayed as text.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@govuk-react/label
Minified + gzip package size for @govuk-react/label in KB

Readme

Label

Import

  import Label from '@govuk-react/label';

Label element to wraps label-text and a form input

Usage

Simple

import { Label, LabelText, HintText, ErrorText, Input } from 'govuk-react'

<Label>
  <LabelText>Example label</LabelText>
  <HintText>Example hint</HintText>
  <ErrorText>Example error</ErrorText>
  <Input value={value} onClick={onClick} />
</Label>

References:

Properties

Prop Required Default Type Description
children true `````` node Text for the label
error false bool Apply error state styling to the component

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.