Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Simple field

A label, a hint or an error, and the control, with the message linked to it.

Installation

pnpm add @heyramzi/ui

Usage

import { SimpleField } from "@heyramzi/ui/shadcn/field";
<SimpleField label="Email" for="email" description="We reply within a day." {error}>
  <input id="email" bind:value={email} />
</SimpleField>

Keyboard and accessibility

  • label is tied to the control through for, which has to match the control's id.
  • The description or error is linked to the control with aria-describedby, so it's read after the label.
  • An error also marks the control invalid and is read out as soon as it appears.

API reference

label string
description string
error string
for string
Id of the control the label binds to. Also picks the control that gets the message link.
labelVariant "default" | "muted"
Default "default"
"default" is text-sm foreground; "muted" is a text-xs micro-label.
class string
children required Snippet
Prop Type Default
label string
description string
error string
for

Id of the control the label binds to. Also picks the control that gets the message link.

string
labelVariant

"default" is text-sm foreground; "muted" is a text-xs micro-label.

"default" | "muted" "default"
class string
children required Snippet