Skip to content
Harness Design System Harness Design System Harness Design System

Label

beta

The Label component is a customizable label for form elements. It includes an optional required indicator and follows consistent styling across the design system.

Usage

import { Label } from '@harnessio/ui/components'
// ...
return (
<>
<Label htmlFor="username">Username</Label>
<input id="username" type="text" />
</>
)

API Reference

The Label component provides a styled label for form elements with customizable options.

<Label
htmlFor="inputId" // [OPTIONAL] ID of the form control this label is associated with
optional // [OPTIONAL] Indicate if the associated form field is optional
>
Label Text
</Label>
Prop
Required
Default
Type
htmlForfalsestring
optionalfalsefalseboolean
classNamefalsestring
childrentrueReactNode