<Field>

<Field>

One input field of a <Tool>, written as a child. It adds nothing a Zod schema does not; it is shorter for a few flat fields.

import { Field } from "curb";

function Field(props: FieldProps): ReactNode;

Props

PropTypeWhat it does
namestringThe input’s name
type"string", "number", "integer", "boolean", "email"Its type
descriptionstringWhat it is, for the model
requiredbooleanWhether the model must fill it

Example

<Tool name="find_policy" description="Find a policy by its number." onSubmit={findPolicy}>
  <Field name="number" type="string" description="The policy number" required />
</Tool>

Version history

VersionChanges
v0.1.2<Field> introduced