Module Solidtype_heroui.Text_field

HeroUI's TextField: Kobalte's TextField.Root, a field's <div>, with HeroUI's classes from Styles.TextField, and the parts inside it as Kobalte's: its Label names its Input or Text_area, its Description describes it, and its Field_error shows while it is invalid. It keeps its value, controlled or its own, and declares its state as React Aria writes it -- disabled, invalid, read-only, required, and the focus within it.

  <Text_field name="email" is_required=true>
    <Label>"Email"</Label>
    <Input type_=`email placeholder="ada@example.org" />
    <Description>"We'll never share it."</Description>
    <Field_error>"Enter a valid email."</Field_error>
  </Text_field>

Kobalte writes its own state on each part too -- data-valid, data-required and the rest, present and empty -- which HeroUI's styles, reading React Aria's "true", pass over; and gives the field's <div> the group role, and its input aria-required and aria-disabled beside the native required and disabled.

type field = {
  1. variant : unit -> [ `primary | `secondary ] option;
  2. disabled : unit -> bool;
  3. invalid : unit -> bool;
  4. read_only : unit -> bool;
  5. required : unit -> bool;
}

What a field's parts read of it: the variant its input takes where it sets none, and its state.

module Context : sig ... end
module Props : sig ... end