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

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more