Skip to main content

User input types

Where people see these

These input types are the controls a person sees in the Glance setup app on iOS and Android when they add your app to their Glance LED. The inputs your app declares turn into a setup form that the end user fills in on their phone, and each input type below is one kind of control they will see there: a text box, a dropdown, a color picker, a toggle, a date, and so on.

Set app_input_type on an input to choose the control the user gets. There are seven. Each renders a real widget in the app and passes the user's value into your app via ctx.inputs["<key>"].

Free text

app_input_type: free-text

A plain text box, zip codes, names, symbols.

90210

Dropdown

app_input_type: dropdown

Pick one from a choices list.

metric

Selection

app_input_type: selection

Pick several from a choices list.

LAL, BOS

Checkbox

app_input_type: checkbox

An on/off toggle, "live games only".

On

Date

app_input_type: date

A date picker, a countdown target.

2027-01-01

Date (past)

app_input_type: date-past

A date picker capped at today, a birthday.

1994-08-12

Color

app_input_type: color

A color wheel / picker, text tint.

#00FF00

How they look in the app

The controls above are what a person taps and fills in when they add your app. The two free-text inputs in the Traffic Tracker app are a real example:

Two free-text inputs in the Glance app
Each free-text input becomes a text box like these two zip-code fields.

Using them

inputs:
- key: units
app_input_type: dropdown
type: choice
label: Units
default: metric
choices: [metric, imperial]
- key: birthday
app_input_type: date-past
type: string
label: Your birthday

Then in app.star:

def main(c, ctx):
units = ctx.inputs["units"] # "metric" or "imperial"
bday = ctx.inputs["birthday"] # "1994-08-12"
tip

app_input_type is optional. If you omit it, the form falls back to your type (choice becomes a dropdown, everything else becomes free text). Set it when you want a nicer control than a text box.