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.
Input.text({name: String, description?: String, default?: Number|String}) => Input
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.
Input.textArea({name: String, description?: String, default?: Number|String}) => Input
Input.textArea({ name: "people", default: '{ "John": 20 to 50, "Mary": 30 to 90, }' })
checkbox
Creates a checkbox input. Used for Squiggle booleans.
Input.checkbox({name: String, description?: String, default?: Bool}) => Input
Input.checkbox({ name: "IsTrue?", default: true })
select
Creates a dropdown input. Used for Squiggle strings.
Input.select({name: String, options: List(String), description?: String, default?: String}) => Input
Input.select({ name: "Name", default: "Sue", options: ["John", "Mary", "Sue"] })