Published unlisted
Edited
Jan 30, 2021
Insert cell
Insert cell
import {select, textarea} from '@jashkenas/inputs'
Insert cell
object = [{},{}]
Insert cell
viewof select_input2 = select(select_values)
Insert cell
viewof select_input2
Insert cell
select_input2
Insert cell
select_values
Insert cell
viewof select_input = select(select_values)
Insert cell
select_values = ["Spring", "Summer", "Fall", "Winter"]
Insert cell
function selectFunction() { // parenthesis are parameters that get passed into the function
return select(select_values)
}
Insert cell
viewof textarea_input = textarea(textarea_values)
Insert cell
textarea_values = ({value: "Text"})
Insert cell
function textareaFunction() {
return textarea(textarea_values)
}
Insert cell
viewof selectList3 = listInput({
input: v => html.fragment`${viewof select_input} ${viewof textarea_input}`,
min:1,
defaultValue: 0,
})
Insert cell
viewof selectList4 = listInput({
input: v => html.fragment`${selectFunction()} ${textareaFunction()}`,
min:1,
defaultValue: 0,
})
Insert cell
viewof selectList6 = listInput({
input: select(select_values),
min:1,
defaultValue: 0,
})
Insert cell
viewof selectList5 = listInput({
value: ['Spring', 'Winter'],
defaultValue: null,
input: (value, i, values) => html.fragment`
<select style="margin-left: 1em;">
<option value=${null}>---</option>
${select_values.map(d => html.fragment`
<option value=${d} selected=${d === value}>
${d}
</option>
`)}
</select> <input></input>
`,
})
Insert cell
import {html, listInput} from '@harrislapiroff/list-input'
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more