Field, TextField, TextArea, NumberField, PasswordField, SearchField. They are copied into your app’s ui/ by qatjs add input: the code is yours to edit.
Example
We only use it for the receipt.
That address has no @. Enter one like name@example.az.
import { NumberField, PasswordField, SearchField, TextArea, TextField } from'./ui/input/input.qx'exportdefaultfunctionExample() {letemail = state('')return (<divclass="example-grid"><TextFieldlabel="Email"type="email"requiredhelp="We only use it for the receipt."placeholder="name@example.az"bind:value={email} /><TextFieldlabel="Email"error="That address has no @. Enter one like name@example.az."value="leyla.example.az" /><TextFieldlabel="Price"prefix="₼"suffix="per kg"value="84.00" /><TextArealabel="Note to the courier"maxLength={200}value="Qapı zəngi işləmir, zəhmət olmasa zəng edin." /><NumberFieldlabel="Weight"unit="kg"step={0.1}value={2.4} /><PasswordFieldlabel="New password"value="correcthorse"strength={2}strengthText="Fair. Add a number or a symbol."autocomplete="new-password" /><SearchFieldlabel="Search orders"placeholder="Search orders" /></div> )}
email state
Add it
shell1 line
npx qatjs add input
Field
The label, the control (children), the help or the error (the other field components use it too). As a custom element: <ui-field>.
Field: props
Prop
Type
Attribute
label
QatNode
property only
help
QatNode
property only
error
QatNode
property only
required
boolean
yes
disabled
boolean
yes
readonly
boolean
yes
size
'sm' | 'md' | 'lg'
yes
placeholder
string
yes
name
string
yes
id
string
yes
TextField
One line of text: label, help or error, prefix/suffix, clear, a counter when `maxLength` is set. As a custom element: <ui-text-field>.