tuil
ReferenceComponentsForms and controls

FieldProps

FieldProps component contract.

View rawEdit

Type

export interface FieldProps
  extends CommonComponentProps,
    SlottedComponentProps<{
      root: BoxProps;
      label: TextProps;
      description: TextProps;
      control: BoxProps;
      error: TextProps;
      hint: TextProps;
    }> {
  readonly label: string;
  readonly description?: string;
  readonly error?: string | readonly string[];
  readonly field?: { readonly errors: readonly string[] };
  readonly hint?: string;
  readonly required?: boolean;
  readonly children?: ReactNode;
}

Members

MemberTypeRequiredDescriptionRelated types
labelstringYesThe label member uses the string contract.
descriptionstring | undefinedNoThe description member uses the string | undefined contract.
errorstring | readonly string[] | undefinedNoThe error member uses the string | readonly string[] | undefined contract.
field&#123; readonly errors: readonly string[]; &#125; | undefinedNoThe field member uses the &#123; readonly errors: readonly string[]; &#125; | undefined contract.
hintstring | undefinedNoThe hint member uses the string | undefined contract.
requiredboolean | undefinedNoThe required member uses the boolean | undefined contract.
childrenReactNodeNoThe children member uses the ReactNode contract.
variantstring | undefinedNoThe variant member uses the string | undefined contract.
size"sm" | "md" | "lg" | undefinedNoThe size member uses the "sm" | "md" | "lg" | undefined contract.
unstyledboolean | undefinedNoThe unstyled member uses the boolean | undefined contract.
classNamestring | undefinedNoThe className member uses the string | undefined contract.
layoutPartial<Omit<LayoutNodeInput, "id" | "children" | "semantics">> | undefinedNoThe layout member uses the Partial<Omit<LayoutNodeInput, "id" | "children" | "semantics">> | undefined contract.
idstring | undefinedNoThe id member uses the string | undefined contract.
testIdstring | undefinedNoThe testId member uses the string | undefined contract.
roleSemanticRole | undefinedNoThe role member uses the SemanticRole | undefined contract.SemanticRole
disabledboolean | undefinedNoThe disabled member uses the boolean | undefined contract.
readOnlyboolean | undefinedNoThe readOnly member uses the boolean | undefined contract.
selectedboolean | undefinedNoThe selected member uses the boolean | undefined contract.
checkedboolean | undefinedNoThe checked member uses the boolean | undefined contract.
expandedboolean | undefinedNoThe expanded member uses the boolean | undefined contract.
valueTextstring | undefinedNoThe valueText member uses the string | undefined contract.
slotsPartial<SlotComponents<&#123; root: import("ink").BoxProps; label: import("ink").TextProps; description: import("ink").TextProps; control: import("ink").BoxProps; error: import("ink").TextProps; hint: import("ink").TextProps; &#125;>> | undefinedNoThe slots member uses the Partial<SlotComponents<&#123; root: import("ink").BoxProps; label: import("ink").TextProps; description: import("ink").TextProps; control: import("ink").BoxProps; error: import("ink").TextProps; hint: import("ink").TextProps; &#125;>> | undefined contract.BoxProps, SlotComponents, TextProps
slotPropsPartial<SlotProps<&#123; root: import("ink").BoxProps; label: import("ink").TextProps; description: import("ink").TextProps; control: import("ink").BoxProps; error: import("ink").TextProps; hint: import("ink").TextProps; &#125;, object>> | undefinedNoThe slotProps member uses the Partial<SlotProps<&#123; root: import("ink").BoxProps; label: import("ink").TextProps; description: import("ink").TextProps; control: import("ink").BoxProps; error: import("ink").TextProps; hint: import("ink").TextProps; &#125;, object>> | undefined contract.BoxProps, SlotProps, TextProps

Source

View the secondary source reference

On this page