Skip to content

Form Label

Label with required and optional markers for form fields.

Installation

bun add @xerobi/ui
import { FormLabel } from "@xerobi/ui/form-label"

This component is client-side. In Astro, hydrate it with a client directive.

Examples

Default

import { Input } from "@xerobi/ui/input"
import { FormLabel } from "@xerobi/ui/form-label"

export function FormLabelDefault() {
  return (
    <div className="flex w-64 flex-col gap-1.5">
      <FormLabel htmlFor="project-name">Project name</FormLabel>
      <Input id="project-name" placeholder="my-project" />
    </div>
  )
}

API reference

FormLabel

Also accepts every prop of <label> element.

No props of its own.

Styling hooks: [data-slot="form-label"].

Search documentation

Search pages, components and blocks.