Forms

Label

A form label.

Server safeSource

Import

import { Label } from '@the_viveksingh/vivek-ui'

Associate it with a control

htmlFor matches the input id. Field does this for you when you use it.

<Label htmlFor="name">Full name</Label>
<Input id="name" placeholder="Vivek Kumar Singh" />

Required marker

The asterisk is aria-hidden. The control’s own required attribute is what assistive technology reads - announcing "star" on every field is noise.

<Label htmlFor="email" required>Work email</Label>
<Input id="email" type="email" required />

Props

Generated from the package's own type declarations, so this table cannot drift from the code.

Props for Label
PropTypeDefaultDescription
size'sm' | 'md'
requiredbooleanShow a required marker. Purely visual — set `required` on the control too.

Every remaining prop is spread onto the root element, so all standard HTML and ARIA attributes work. className and style are merged with the library's own, never replaced, and the ref forwards to the root DOM node.

Rendering

Server safe

Label carries no 'use client' directive and renders directly in a React Server Component. No client JavaScript is shipped for it.