Build Interactive Notebooks

In Desmos Notebook, you can use features such as editable expressions, sliders, and buttons to make a notebook interactive for viewers.

To learn more about Notebook, visit our Getting Started: Desmos Notebook article. Or, try all the interactive features in the Match the Intersection example notebook to jump right in.

 

Desmos Notebook is a new tool, so you can expect bugs, surprises, and missing features. We’ll be adding new capabilities in the coming weeks and months and might accidentally break some of your saved notebooks as we do. Please reach out to us at feedback@desmos.com with any bug reports or feature requests.

 

Editable Expressions

When you add an expression line to a notebook, you can choose how viewers will be able to interact with that line.

By default, expression lines are locked, and viewers cannot change them. However, you can click Expression Options Expression Options icon and then Editable to allow viewers to type into that expression line when viewing your shared notebook. This way, they can set their own variable values or function definitions.

To see this behavior, click Preview while in the editor to see how your shared notebook will appear to others.

Screenshot showing two expression lines, a=2 and b=3, and the Expression Options menu for b open with “Add Slider” and “Add Button” buttons, a “For Viewers” section with unchecked “Hidden” and checked “Editable” checkboxes, and a “Delete” button.

 

Variable Sliders

Just like in other Desmos graphing tools, you can add and adjust variable sliders that instantly update any graphs or expressions that use the variable. When viewing a shared notebook, viewers will be able to drag sliders within specific bounds.

Click Add Slider from Expressions Options in an expression line, or Variable Options Variable Options icon in the Notebook Variables menu.

Screenshot of the Notebook Variables menu showing a variable a with a value of 3, and its Variable Options menu open with color choices, an “Add Slider” and “Add Button” button, and a “Go to Definition” button.

You can adjust slider settings to control their appearance and behavior. Click Slider Options Slider Options icon to access these settings. You can add a label (which defaults to the name of the variable) or toggle the display of the slider value.

You can also adjust the upper and lower bounds and step size, which determine the values that your variable can take. If you define a variable in a graph and then connect it to your notebook, you can change its slider settings in the graph where it’s defined or in a slider in the notebook.

Screenshot of a slider item with its options menu open showing a range of 0 to 10, Label and Show Slider value checked, and a “Go to Definition” button.

 

Actions

You can define and run actions in Notebook similar to how you would in the other calculators.

First, define an action in an expression line in your notebook. Then, click Action Action icon to run the action on each click. All actions are visible both when editing and viewing a notebook.

Screenshot showing five expression lines: a=2, b=3, a→2, a→a+3, and b→2a, with the last three expressions showing an Action icon.

 

Add Buttons

Buttons allow you to run actions directly from a notebook.

First, define a notebook variable either in an expression line or by connecting it from a graph. Then, open the Item menu and click Button.

You can also add a button directly from Variable Options or the Expressions Options of a variable or an expression line that contains the definition of an action.

Animation showing how to add a button from the Item menu, then changing its label to “Add” and setting its On Click action to a→a+1.

Once you add a button, you can click Button Options Button Options icon to change its style and function.

You can change the label and color to customize a button’s appearance. In the On Click section, you can specify the action (or multiple actions separated by commas) that the button will run. If you define an action by a variable name in an expression line in your notebook, you can also reference that variable name here.

You can place your buttons inline with text throughout your notebook, including in columns, headers, or different alignments. You cannot drag and drop buttons to arrange them in your notebook, but you can copy and paste them instead.

Explore the Simple Button Example.

Screenshot of an expression line a=1 and a button with its option menu open showing its Label as “Add 1”, On Click action set to a→a+1, a row of colors with green selected, and a “Delete Button” option.

 

Learn More

Please write in with any questions or feedback to support@desmos.com.