Chapter 04 Fields
Input group
A text field with fixed text inside its box, before or after the value: a currency, a unit, a domain. The text is read with the field, so 'Price, EGP' is heard, but it is never part of the value.
import { TextFieldComponent } from '@okaapi-ui/angular';Before and after
Set prefix or suffix on a text field.
EGP
kg
https://.okaapi.shop
<ui-text-field label="Price" type="number" prefix="EGP" />
<ui-text-field label="Weight" type="number" suffix="kg" />
<ui-text-field label="Shop address" prefix="https://" suffix=".okaapi.shop" />In Arabic
جنيه
<ui-text-field label="السعر" type="number" suffix="جنيه" />When to use something else
| If you need | Use |
|---|---|
| A number with − and + buttons | Number field |
| A phone number with its country code | Phone field |
| A search box with a clear button | Search field |
Inputs
| Name | Type | Default | What it does |
|---|---|---|---|
prefix | string | — | Text before the value, such as "EGP". Read after the label. |
suffix | string | — | Text after the value, such as "kg" or ".com". |
label | string | — | Required. Every other Text field option works too: see Text field. |
Keyboard and screen readers
- The text before or after the value is read with the field, such as Price, EGP, but is never part of the value.