Published
Edited
Aug 17, 2022
Insert cell
Insert cell
import { toInput } from "@kotelnikov/to-input"
Insert cell
Insert cell
viewof example1 = toInput(htl.html`<div>
<h3>This is an input!</h3>
${Inputs.text({ value: "Hello!" })}
</div>`)
Insert cell
example1
Insert cell
Insert cell
Insert cell
example2
Insert cell
Insert cell
viewof example3 = toInput(
htl.html`<div>
<h3>This is an HTML with multipe inputs!</h3>
<div style="display: flex; gap: 0.5em;">
<div>First name: ${Inputs.text({ value: "John" })}</div>
<div>Last name: ${Inputs.text({ value: "Smith" })}</div>
</div>
<div>
${Inputs.toggle({ label: "Accept our agreement:", value: true })}
</div>
</div>`,
["firstName", "lastName", "ok"]
)
Insert cell
example3
Insert cell
Insert cell
signature
Insert cell
viewof signature = drawLine()
Insert cell
simplify = require("simplify-js")
Insert cell
Insert cell
example4
Insert cell
viewof example4 = {
return toInput(
htl.html`<div>
<h3>This is an HTML with multipe inputs!</h3>
<div style="display: flex; gap: 0.5em;">
<div>First name: ${Inputs.text({ value: "John" })}</div>
<div>Last name: ${Inputs.text({ value: "Smith" })}</div>
</div>
<div>
Signature:
${drawLine()}
</div>
<div>
${Inputs.toggle({ label: "Accept our agreement:", value: true })}
</div>
</div>`,
["firstName", "lastName", "signature", "ok"]
);
}
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