Public
Edited
Jan 11, 2023
Insert cell
Insert cell
Insert cell
Insert cell
viewof textInput = Inputs.text({label: "Input 1"})
Insert cell
textInputIsEmpty = textInput.length === 0
Insert cell
viewof storeForInput2 = Inputs.input()
Insert cell
Insert cell
storeForInput2
Insert cell
{
if (!textInputIsEmpty) {
return Inputs.bind(
Inputs.text({ label: "Input 2 (dependent)" }),
viewof storeForInput2
);
}

return md``;
}
Insert cell
{
if (!textInputIsEmpty && storeForInput2.length !== 0) {
return md`Neither is empty!`;
} else if (storeForInput2.length === 0) {
return md`First isn't empty, but the second is!`;
}
return md``;
}
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