Squiggle logoSquiggle
API

Input

Inputs are now only used for describing forms for calculators.

Inputs are now only used for describing forms for calculators.

text

Creates a single-line input. This input can be used for all Squiggle types.

Signatures
Input.text({name: String, description?: String, default?: Number|String}) => Input
Examples
Input.text({ name: "First", default: "John" })
Input.text({ name: "Number of X in Y", default: '20 to 300' })

textArea

Creates a multi-line input, sized with the provided input. This input can be used for all Squiggle types.

Signatures
Input.textArea({name: String, description?: String, default?: Number|String}) => Input
Examples
Input.textArea({ name: "people", default: '{
  "John": 20 to 50, 
  "Mary": 30 to 90,
}' })

checkbox

Creates a checkbox input. Used for Squiggle booleans.

Signatures
Input.checkbox({name: String, description?: String, default?: Bool}) => Input
Examples
Input.checkbox({ name: "IsTrue?", default: true })

select

Creates a dropdown input. Used for Squiggle strings.

Signatures
Input.select({name: String, options: List(String), description?: String, default?: String}) => Input
Examples
Input.select({ name: "Name", default: "Sue", options: ["John", "Mary", "Sue"] })

On this page