<textInput/>
<textInput/>
is an Input
component that renders a form input field for text responses from the user.
Attributes and Properties
Attribute | Type | Values |
---|---|---|
anchor = "…" | point | |
bindValueTo = "…" | ||
draggable = "…" | boolean | "true" "false" |
expanded = "…" | boolean | "true" "false" |
height = "…" | componentSize | |
labelIsName = "…" | boolean | "true" "false" |
positionFromAnchor = "…" | text | "upperright" "upperleft" "lowerright" "lowerleft" "top" "bottom" "left" "right" "center" |
prefill = "…" | text | |
width = "…" | componentSize |
Property | Type |
---|---|
$t.anchor | point |
$t.characters | [ text ] |
$t.collaborateGroups | collaborateGroups |
$t.disabled | boolean |
$t.draggable | boolean |
$t.expanded | boolean |
$t.fixed | boolean |
$t.fixLocation | boolean |
$t.height | componentSize |
$t.hidden | boolean |
$t.immediateValue | text |
$t.immediateValueChanged | boolean |
$t.label | label |
$t.labelIsName | boolean |
$t.list | [ text ] |
$t.numCharacters | integer |
$t.numListItems | integer |
$t.numWords | integer |
$t.positionFromAnchor | text |
$t.prefill | text |
$t.text | text |
$t.value | text |
$t.valueChanged | boolean |
$t.width | componentSize |
$t.words | [ text ] |
Example: Default <textInput/>
The default <textInput/>
blank is wide enough for approximately 2-4 words to be visible at a time.
Example: Large <textInput/>
The expanded <textInput/>
blank is approximately large enough for 4-6 sentences to be visible at a time.
Example: <textInput/>
with <label>
child
The <textInput/>
component can take a nested <label>
child.
Example: <textInput/>
for graded free-response
The <textInput/>
can be nested in an <answer>
with the handGraded
attribute for graded free-response style questions.
Example: <textInput/>
for graded closed-form text response
The <textInput/>
can be nested in an <answer>
with the handGraded
attribute for graded free-response style questions.
Example: <textInput/>
on a <graph>
A <textInput/>
can be placed on a <graph>
. Use the anchor
attribute to adjust its starting location. Click on the border of the <textInput/>
to drag it around.
Attribute Example: prefill
The prefill
attribute specifies initial text for the <textInput/>
.
Attribute Example: expanded
The expanded
attribute renders a larger <textInput/>
space. The dimensions of the input space can be further customized with the height
and width
attributes.
Attribute Example: width
The default width of the input space can be customized with the width
attribute.
Attribute Example: height
The default height of the input space can be customized with the height
attribute. This must be used in combination with the expanded
attribute.
Attribute Example: labelIsName
The labelIsName
attribute can be used to assign an automatic label to a <textInput/>
.
Attribute Example: draggable
The draggable
attribute can be set to false to prevent users from moving the <textInput/>
on a <graph>
.
Property Example: value
The value
property contains the finalized value the user entered into the input. It is updated when the user presses enter or navigates away.
Property Example: immediateValue
The immediateValue
property contains the value the user enters into the input as they are typing.
Property Example: attributes as properties
The attributes illustrated in the example are also accessible as properties. The value stored in a <label>
child can also be rendered using the label
property.