Interactivity with @bind
and PlutoUI
Making your notebook interactive is very easy with Pluto! This article will teach you how to use @bind
to add interactive UI like sliders, buttons, scrubbables, text fields, and more.
@bind
with PlutoUI
The easiest way to get started is with PlutoUI. Add the following code in your notebook:
using PlutoUI
@bind apples Slider(5:50)
apples
repeat("π", apples)
This is what you get:
Global variables
The core idea with @bind
is that you can control a global variable with a UI element. Because Pluto has reactive global variables, it is up to your creativity what you do with it! Anything that depends (indirectly) on the bound variable will automatically update when you change the UI element.
Discover more widgets!
To see the complete list of UI that PlutoUI provides, including buttons, file upload and layout, check out the PlutoUI documentation! π
Interactivity
Sliders, buttons, dropdowns, and more using PlutoUI.jl!