Dashboard Parameters


You may have a set of parameters that are used to create different variations of a dashboard. For example:

  • Showing results for a specific geographic location.
  • Running a report that covers a specific time period.
  • Running a single analysis multiple times for different assumptions.

This article describes how to define and use computational parameters with Quarto.


Adding parameter definitions to a dashboard works differently depending on whether you are using the Jupyter or Knitr engine.


For Jupyter, Quarto uses the same syntax for defining parameters as Papermill. To parameterize a dashboard, designate a cell with the tag parameters and provide appropriate default values:

#| tags: [parameters]

alpha = 0.1
ratio = 0.1

The parameters are available in the top level environment:


When the dashboard is executed with a set of new parameters a cell is injected which overrides these defaults as appropriate.


For Knitr, the standard Knitr params YAML option is used to define parameters. For example:

  alpha: 0.1
  ratio: 0.1

The parameters are available in the params list:



To render using different parameters you can pass them on the command line using the -P flag (this works for both .ipynb or .qmd files):

quarto render dashboard.ipynb -P alpha:0.2 -P ratio:0.3

Alternatively you can create a YAML file that defines the parameter values you want to render with, then call quarto render with the --execute-params flag:

quarto render dashboard.qmd --execute-params params.yml