AsterUIDocsv1.0.2

Docs / Component reference

Label & Field

Associate a field with its visible name. Field keeps the label and custom control together.

Label example

Install

sh
npx @fierst/ui@1.0.2 add label

Registry dependencies: theme.

Exports from ./ui/label: Label, Field.

Download the registry source for label 1.0.2.

API contracts

ts
export function Label({
  for: htmlFor,
  required = false,
  class: extraClass,
  children,
}: {
  for?: string;
  required?: boolean;
  class?: string;
  children?: View;
})

export function Field({
  label,
  for: htmlFor,
  required = false,
  hint,
  error,
  class: extraClass,
  children,
}: {
  label?: string;
  for?: string;
  required?: boolean;
  hint?: string;
  error?: string | null;
  class?: string;
  children?: View;
})