Hyperview

Hyperview

  • Guides
  • Examples
  • Reference
  • Blog

›Input Elements

Reference

  • Index

Behaviors

  • Behavior Attributes
  • <behavior>
  • Alert
  • Share

Display Elements

  • <doc>
  • <screen>
  • <header>
  • <body>
  • <view>
  • <text>
  • <image>
  • <list>
  • <section-list>
  • <section>
  • <section-title>
  • <items>
  • <item>
  • <spinner>
  • <web-view>

Input Elements

  • <form>
  • <text-field>
  • <select-single>
  • <select-multiple>
  • <option>
  • <picker-field>
  • <picker-item>
  • <switch>
  • <date-field>

Style Elements

  • <styles>
  • <style>
  • <modifier>

Hyperview Client

  • Hyperview component
  • Custom elements
  • Custom behaviors
  • Loading Screen

Hyperview Navigation

  • <navigator>
  • <nav-route>

<picker-field>

The <picker-field> element represents a single-line input field. When pressed, the field focused and a modal appears, allowing the user to select one of the available options. The modal uses a platform-specific widget:

  • on Android, it shows the system picker modal
  • on iOS, the spinner-picker appears at the bottom of the screen

A picker field with no value selected: unselected

On iOS, pressing the field brings up a bottom sheet modal with a picker focused

After selecting a value and pressing "Done", the field has the value selected. focused

Like other input elements, the selected value of the picker gets serialized by the parent form when making requests to the server.

<picker-field
  field-style="Input"
  field-text-style="Input__Text"
  name="user_choice"
  placeholder="Select choice"
>
  <picker-item label="Choice 0" value="0" />
  <picker-item label="Choice 1" value="1" />
  <picker-item label="Choice 2" value="2" />
  <picker-item label="Choice 3" value="3" />
</picker-field>

Structure

A <picker-field> element can appear anywhere within a <form> element. Its children must only be <picker-item> elements.

Attributes

  • name
  • value
  • placeholder
  • done-label
  • cancel-label
  • field-style
  • field-text-style
  • modal-style
  • modal-text-style
  • id
  • hide
  • allowFontScaling
  • maxFontSizeMultiplier
  • minimumFontScale

Behavior attributes

A <picker-field> element accepts the standard behavior attributes, including the following triggers:

  • blur
  • change
  • focus

name

TypeRequired
stringYes

The name of the picker field within a <form> element. This name will be used when serializing a form to form data that gets sent in a server request.

value

TypeRequired
stringNo (defaults to blank)

The value of the picker field. This string gets rendered into the string and can be edited by the user. Set this value in the XML to pre-populate the picker field.

placeholder

TypeRequired
stringNo

A label that appears within the picker field. The placeholder only appears when the field is empty.

done-label

TypeRequired
stringNo

This label appears in the button of the iOS modal. Pressing the button will apply the selected value to the field. Defaults to "Done".

cancel-label

TypeRequired
stringNo

This label appears in the button of the iOS modal. Pressing the button will ignore the selected value, and the value in the picker field will remain unchanged.

field-style

TypeRequired
stringNo

A space-separated list of styles to apply to the picker field container. This is the visual element that surrounds the selected picker value. You can use these styles to define borders, margin, and padding around the picker field. See Styles. Note that text style rules cannot be applied to the container.

field-text-style

TypeRequired
stringNo

A space-separated list of styles to apply to the text value of the picker field. Use these styles to define the font size, color, and weight of the value in the picker field. See Styles. Note that only text style rules can be applied to the text.

modal-style

TypeRequired
stringNo

A space-separated list of styles to apply to the iOS bottom-sheet modal. You can use these styles to define borders, margin, and padding around the bottom modal that appears on iOS. On Android, the system defines the look of the modal, so these styles will not be applied. See Styles. Note that text style rules cannot be applied to the modal.

modal-text-style

TypeRequired
stringNo

A space-separated list of styles to apply to the buttons in the iOS bottom-sheet modal. You can use these styles to define the size, color, and weight of the buttons in the iOS modal. On Android, the system defines the look of the modal, so these styles will not be applied. See Styles. Note that text style rules cannot be applied to the modal.

modal-animation-duration

TypeRequired
numberNo

The duration in milliseconds that the open and close animation (including the fading animation of the overlay) of the picker modal for IOS takes. Defaults to 250ms.

modal-overlay-animation-duration

TypeRequired
numberNo

The duration in milliseconds that the open and close animation of the picker modal overlay for IOS takes. Defaults to value of modal-animation-duration.

modal-dismiss-animation-duration

TypeRequired
numberNo

The duration in milliseconds that the close animation of the picker modal for IOS takes. Defaults to value of modal-animation-duration.

modal-dimiss-overlay-animation-duration

TypeRequired
numberNo

The duration in milliseconds that the close animation of the picker modal overlay for IOS takes. Defaults to value of modal-overlay-animation-duration.

id

TypeRequired
stringNo

A global attribute uniquely identifying the element in the whole document. Add an id if you need to reference this element in behavior attributes (either as a target or href source).

hide

TypeRequired
false (default), trueNo

If hide="true", the element will not be rendered on screen. If the element or any of the element's children have a behavior that triggers on "load" or "visible", those behaviors will not trigger while the element is hidden.

allowFontScaling

TypeRequired
booleanNo

Specifies whether fonts should scale to respect Text Size accessibility setting

maxFontSizeMultiplier

TypeRequired
numberNo

Specifies whether fonts should scale to respect Text Size accessibility setting

minimumFontScale (iOS)

TypeRequired
numberNo

Specifies the smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).

← <option><picker-item> →
  • Structure
  • Attributes
Hyperview
Docs
ExamplesHyperview Reference
More
BlogGitHub
Copyright © 2025 Instawork