API
Demo
@alinea/input.text
/**
Create a text field configuration
*/
export function
createText
(
label
:
Label
,
options
:
TextOptions
)
:
TextField
/**
Create a text field configuration
*/
export function
text
(
label
:
Label
,
options
:
TextOptions
)
:
TextField
/**
Internal representation of a text field
*/
export interface
TextField
extends
Scalar
<
string
>
{
label
:
Label
options
:
TextOptions
shape
:
Shape
<
string
,
{
}
>
view
:
FieldRenderer
<
string
,
{
}
,
Field
<
string
,
{
}
,
string
>
>
query
<
P
>
(
field
:
Expr
<
V
>
,
pages
:
Pages
<
P
>
)
:
undefined
|
Expr
<
Q
>
}
/**
Optional settings to configure a text field
*/
export type
TextOptions
=
{
/**
Focus this input automatically
*/
autoFocus
:
boolean
/**
Add instructional text to a field
*/
help
:
Label
/**
An icon (React component) to display on the left side of the input
*/
iconLeft
:
ComponentType
/**
An icon (React component) to display on the right side of the input
*/
iconRight
:
ComponentType
/**
A default value
*/
initialValue
:
string
/**
Display a minimal version
*/
inline
:
boolean
/**
Allow line breaks
*/
multiline
:
boolean
/**
Field is optional
*/
optional
:
boolean
/**
Width of the field in the dashboard UI (0-1)
*/
width
:
number
}