Skip to content
QwryAI
Documentation
Pages

Widgets

Form Inputs

Components that collect input from the visitor: Form, Input, Textarea, Select, DatePicker, Checkbox and RadioGroup

Common Form Input Props

Input, Textarea, Select, DatePicker, Checkbox and RadioGroup share these props.

PropTypeDefaultDescription
namestring—The field's name. Its current value is stored in the Widget's data under this name.
requiredbooleanfalseThe form can't be submitted while the field is empty.
disabledbooleanfalseGreys the field out and blocks input.
onChangeActionaction—Function to run each time the value changes.
ariaLabelstringthe field's nameName read by screen readers when no visible label is linked to the field.

Form

Groups fields and runs one function when the visitor submits them. Put a Button with submit inside to submit the form.

jsx
<Form onSubmitAction={{ functionName: "requestReturn" }} gap={3}>
  <Label value="Order number" fieldName="orderNumber" />
  <Input name="orderNumber" placeholder="QW-10482" required />
  <Label value="Reason" fieldName="reason" />
  <Textarea name="reason" rows={3} />
  <Button label="Request return" submit />
</Form>

Props

Form accepts all common layout props, plus:

PropTypeDefaultDescription
directionrow | colcolDirection of the form's children.
onSubmitActionaction—Function to run on submit. Every field's value is saved under its name first, so the function can use them all.

The browser checks the fields before onSubmitAction runs. A field that is required and empty, or that doesn't match its pattern or its inputType (an invalid email address, for example), stops the submit and the browser points to it. A Button with its own onClickAction and no submit runs its function without these checks.

Input

A single-line text field for short answers such as an email address, a name or an order number.

jsx
<Input name="email" inputType="email" placeholder="you@example.com" required />

Props

In addition to the common props, Input accepts:

PropTypeDefaultDescription
inputTypetext | email | password | number | tel | urltextKind of value. It sets the keyboard on phones and the browser's format check.
placeholderstring—Hint shown while the field is empty.
defaultValuestring—Starting value.
valuestring—Value bound to the Widget's data.
patternstring—A regular expression the value must match.
variantoutline | softoutlineoutline draws a border; soft uses a tinted fill.
size3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xlmdField height, from 22 px (3xs) to 48 px (3xl). md is 32 px.
gutterSize2xs | xs | sm | md | lg | xlmatches sizeInner horizontal padding, from 6 px to 16 px.
pillbooleanfalseFully rounded ends.
autoFocusbooleanfalsePuts the cursor in the field when the Widget appears.
autoSelectbooleanfalseSelects the field's text when it gets focus.
allowAutofillExtensionsbooleanfalse (true for password)Lets password managers and autofill extensions fill the field.

Textarea

A multi-line field for longer answers, such as a message or a reason.

jsx
<Textarea name="message" placeholder="Tell us what happened" rows={4} autoResize />

Props

In addition to the common props, Textarea accepts:

PropTypeDefaultDescription
placeholderstring—Hint shown while the field is empty.
defaultValuestring—Starting value.
valuestring—Value bound to the Widget's data.
rowsnumber3Visible lines.
autoResizebooleanfalseGrows with the text instead of showing a resize handle.
maxRowsnumber10With autoResize, the most lines it grows to before scrolling.
variantoutline | softoutlineVisual style.
size3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xlmdSize.
gutterSize2xs | xs | sm | md | lg | xlmatches sizeInner horizontal padding.
autoFocusbooleanfalsePuts the cursor in the field when the Widget appears.
autoSelectbooleanfalseSelects the text when the field gets focus.
allowAutofillExtensionsbooleanfalseLets autofill extensions fill the field.

Select

A dropdown for choosing one option, with optional search and a clear button.

jsx
<Select
  name="size"
  placeholder="Choose a size"
  options={[
    { label: "Small", value: "s" },
    { label: "Medium", value: "m", description: "Fits most" },
    { label: "Large", value: "l", disabled: true }
  ]}
  block
/>

Props

In addition to the common props, Select accepts:

PropTypeDefaultDescription
options{label, value, disabled?, description?}[]—The choices. label is the text shown, or {text, color?, weight?} to style it; value is what's stored.
placeholderstringSelectShown while nothing is chosen.
defaultValuestring—The option chosen at the start.
valuestring—Value bound to the Widget's data.
variantoutline | soft | ghostoutlineghost has no border or fill until hovered.
size3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xlmdSize.
widthnumber | string—Fixed width.
blockbooleanfalseStretches to the full width of its container.
pillbooleanfalseFully rounded ends.
clearablebooleanfalseAdds a button that clears the choice.
searchablebooleanfalseAdds a search box that filters the options.
searchPlaceholderstringSearch...Hint in the search box.
searchEmptyMessagestringNo results found.Shown when the search matches nothing.

DatePicker

A date field that opens a calendar.

jsx
<DatePicker name="pickupDate" placeholder="Pick a date" min="2026-12-02" max="2026-12-31" clearable />

Props

In addition to the common props, DatePicker accepts:

PropTypeDefaultDescription
placeholderstringSelect dateShown while no date is chosen.
defaultValuestring (yyyy-MM-dd)—The date chosen at the start.
valuestring (yyyy-MM-dd)—Value bound to the Widget's data.
minstring (yyyy-MM-dd)—Earliest date that can be chosen.
maxstring (yyyy-MM-dd)—Latest date that can be chosen.
variantoutline | soft | ghostoutlineVisual style.
size3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xlmdSize of the field.
sidetop | bottom | left | rightbottomWhich side the calendar opens on.
alignstart | center | endcenterHow the calendar lines up with the field.
blockbooleanfalseStretches to the full width of its container.
pillbooleanfalseFully rounded ends.
clearablebooleanfalseAdds a button that clears the date.

Checkbox

A single on/off choice with a label.

jsx
<Checkbox name="giftWrap" label="Add gift wrapping" />

Props

In addition to the common props, Checkbox accepts:

PropTypeDefaultDescription
labelstring—Text next to the box.
defaultCheckedbooleanfalseWhether it starts checked.
checkedboolean—Value bound to the Widget's data.

RadioGroup

A set of options of which the visitor picks exactly one.

jsx
<RadioGroup
  name="delivery"
  defaultValue="standard"
  direction="col"
  options={[
    { label: "Standard (3–5 days)", value: "standard" },
    { label: "Express (next day)", value: "express" }
  ]}
/>

Props

In addition to the common props, RadioGroup accepts:

PropTypeDefaultDescription
options{label, value, disabled?}[]—The choices.
defaultValuestring—The option chosen at the start.
valuestring—Value bound to the Widget's data.
directionrow | colrowSide by side, or stacked.

Next steps

Explore the documentation