Skip to content

Label

The Label component is a customizable label for form elements. It shows a required indicator by default, supports an optional tooltip and suffix, and follows consistent styling across the design system.

Variations

Optional

By default a label shows a required indicator (*). Set optional to mark the field as not required — this hides the indicator.

With tooltip (Informer)

The Label component supports displaying a tooltip with additional information. Use the tooltipContent prop to provide the tooltip content, and pass additional configuration via the tooltipProps prop.

Suffix

Use the suffix prop to place an element — such as an action button — on the right side of the label.

Installation

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