Progress bars

Slydekit provides progress bars to indicate either the progress of the section or the progress of the entire presentation. These function are intended to be used in a custom theme.

All the progress bars are built upon the progress-bar function, whose signature is:

#let progress-bar(
  ratio,
  active-color,
  inactive-color,
  row-height: (),
  gutter: ()
)
Argument
ratio
number

The ratio of the progress bar, which is a number between 0 and 1. For example, a ratio of 0.5 means that the progress bar is half filled.

Argument
active-color
color

The color used to fill the active part of the progress bar.

Argument
inactive-color
color

The color used to fill the inactive part of the progress bar.

Argument
row-height – default: ()
length

The height of the progress bar. If not specified, the height will be determined by the content

Argument
gutter – default: ()
length

The gutter between the active and inactive parts of the progress bar. If not specified, the gutter will be determined by the content

Section progress bar

Section progress bar is a horizontal bar that indicates the progress of the current section in relation to the total number of sections in the presentation.

#let section-progress-bar(active-color, inactive-color)
Argument
active-color
color

The color used to fill the active section indicator.

Argument
inactive-color
color

The color used to fill the inactive section indicators.

For example, in the metropolis theme, section-progress-bar is used as follows:

#let color-theme = (
  primary: rgb("#eb811b"),
  secondary: rgb("#d6c6b7"),
  focus: rgb("#23373b"),
  background: rgb("#fafafa"),
  header: rgb("#23373b"),
  footer: rgb("#23373b").lighten(20%),
)

#show heading.where(level: 1): it => {
    // Formatting the content
    ...

    // Using the section progress bar
    stack(
      dir: ttb,
      spacing: 0.5em,
      [*#it.body*],
      block(
        height: 2pt,
        width: 100%,
        spacing: 0pt,
        section-progress-bar(colors-theme.primary, colors-theme.secondary)
      ),
    )
  }

Slide progress bar

Slide progress bar is a horizontal bar that indicates the progress of the current slide in relation to the total number of slides in the presentation.

#let slide-progress-bar(active-color, inactive-color, height: 2pt)
Argument
active-color
color

The color used to fill the active slide indicator.

Argument
inactive-color
color

The color used to fill the inactive slide indicators.

Argument
height – default: 2pt
number

The height of the progress bar. The default value is 2pt.

For example, in the metropolis theme, slide-progress-bar is used in the footer of the slide as follows:

let footer = context {
      // Footer content
      ...

      // Progress bar
      #full-width(anchor: bottom, slide-progress-bar(colors-theme.primary, colors-theme.secondary, height: 2.5pt))
    ]
  }