@govuk-react/label-text

Styled span element with children displayed as text.

Stats

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

Readme

LabelText

Import

  import LabelText from '@govuk-react/label-text';

Usage

Styled text to use as a label for a form input.

This is not a label element by default as it is assumed it will be wrap with Label.

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

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.