Skip to main content

Text

Element type: Dictionary

Display a text field which can be filled by the user.

Keys​

NameTypePossible valuesRequired
TypeStringInputRequired
InputTypeStringTextRequired
VariableString-Required
LabelString-
LabelFontConfigurationDictionary (Font)-
DistributionStringFit, Center
PercentWidthNumber0...1
AlignmentStringLeft, Center, Right
PlaceholderString
ValidationDictionary
MarginsDictionary (Margins)-
BorderDictionary (Border)-
Condition PRODictionary (Condition)-

Detail​

Type Required​

Type: String
Explanation: The type of the component has to be Input.

InputType Required​

Type: String
Explanation: The type of the component has to be Text.

Variable Required​

Type: String
Explanation: The variable used within the application and as the key used in the input file Octory will create to let you retrieve the user inputs.

Label​

Type: String
Explanation: The label lets you give some insight to the end user about the value they need to enter. Its text will generally be placed on the left side of the input field.

info

If you do not specify a label, the input field will be centered. To keep the alignment with other input components which have a label, give the Label a whitespace for value.

LabelFontConfiguration​

Type: Dictionary (Font)
Explanation: Let you specify the font configuration to use. Default is "DefaultPrimary" if specified in the Font styles in the configuration file, or system font otherwise.

Distribution​

Type: String
Possible values: Fit, Center
Default: Center
Explanation: Specify how the label and the input field are stacked.

  • Fit gives them as much space as they need, but the input component will not be aligned with the other ones.
  • Center align the label and the input field in the horizontal middle of its container. This allow several input components to be aligned, although it may crop the text label.

PercentWidth​

Type: Number
Possible values: 0...1
Explanation: This value allows you to give more width to an input component, by specifying the percentage width it should take in its container. Default is most often 0.4.

Alignment​

Type: String
Possible values: Left, Center, Right
Availability: 3.1.0+
Explanation: Moves the label and the control together, as a single cluster, to the chosen edge of the row.

info

This key has no default. When it is absent, the input keeps the historical placement driven by Distribution and PercentWidth, so existing configurations are unchanged.

Alignment is independent from Distribution: Distribution decides how wide the label and the control are, Alignment decides where that cluster sits in the row. Note that a labeled input using Distribution set to Center keeps its right aligned label only while Alignment is absent.

Placeholder​

Type: Number
Explanation: Text which appears in the text field to show to the end user what kind of value is needed.

Validation​

Type: Dictionary
Explanation: Allows you to validate the value entered by the user in the TextInput Component.

Input Text Validation​

NameTypeRequired
WarningTextString
FontConfigurationDictionary (Font)
RegexStringRequired

WarningText​

Type: String
Explanation: The text to display to the user when the input is empty or its value is incorrect. Default is "Incorrect or empty value".

FontConfiguration​

Type: Dictionary (Font)
Explanation: The font configuration to use for the warning text.

Regex Required​

Type: String
Explanation: The pattern regular expression to use to validate the user input.

Margins​

Type: Dictionary (Margins)
Explanation: Add padding to the component's sides.

Border​

Type: Dictionary (Border)
Explanation: Add a top or bottom border to a component.

Condition PRO​

Type: Dictionary (Condition)
Explanation: Allows to hide or show the component using a boolean expression.

Example​

Ask for the user’s Mac asset tag, with a validation to authorize patterns like 3 groups of 3 alphanumeric characters, separated by hyphens.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Slides</key>
<array>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>Input</string>
<key>InputType</key>
<string>Text</string>
<key>Label</key>
<string>What is your Mac asset tag ?</string>
<key>Variable</key>
<string>AssetTag</string>
<key>Placeholder</key>
<string>ABC-178-CD5</string>
<key>Validation</key>
<dict>
<key>Regex</key>
<string>[a-zA-Z0-9]{3}-[a-zA-Z0-9]{3}-[a-zA-Z0-9]{3}</string>
<key>WarningText</key>
<string>Empty or incorrect format</string>
</dict>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>