Components

Label

Label is a themed version of the native label element that can be paired with other form components like Input, Textarea, Radio and Checkbox.

Form inputs must always have a label. Ideally, this label is visual, but in all cases, the label must be accessible to technology like screen readers. The easiest way to label an input field is by using this component and providing an htmlFor property that matches the id of the input field being labelled.

If the label absolutely cannot be visible, you can visually hide it or use an aria-label on the input field itself.

import { Label } from '@sproutsocial/racine'

Properties

System props

System props apply standard sets of properties to a component that can be used to alter its appearance on the fly.

COMMON
TYPOGRAPHY
Learn more
NameTypeDefaultDescriptionRequired?
htmlForstring
id of the form element and data-qa-attribute
childrenReactNode
<Text /> to render in the label

Recipes

Label with icon