Examples

The source behind the deck.

Tabsets on slides, with the source for each and what the preview deck does with it.

The preview deck is built by this site. This page is the source behind it. A tab arriving on an arrow press is not something a page of prose can show, so open the deck alongside this one.

A tabset

::: {.panel-tabset}

### First

The first tab.

### Second

The second, reached with the next arrow press.

:::

Each tab is a fragment, so the arrow keys step through them without leaving the keyboard.

Opening on a given tab

::: {.panel-tabset tab-active="1"}

### One

### Two

:::

The index counts from zero, so 1 is the second tab and the slide arrives with Two open. An index the tabset does not have falls back to the first tab. The attribute is emitted as data-tab-active in the HTML.

Fragments inside a tab

::: {.panel-tabset}

### With reveals

- [First point.]{.fragment}
- [Second point.]{.fragment}

### Plain

:::

Fragments inside a tab are indexed within it, so the points arrive before the next tab does.

Several tabsets on one slide

::: {.panel-tabset}

### A

### B

:::

::: {.panel-tabset}

### X

### Y

:::

They are navigated one after another rather than in parallel. A PDF export reads the first tabset only, so the second one prints on its first tab.

Printing

Each tab is placed on its own page in a PDF export, so a printed deck shows all of them.

Opt a slide out where that is not wanted:

## A slide {tabset-skip-pdf-clone="true"}

Its tabset then stays on one page, showing the first tab alone. The attribute has no effect under pdf-separate-fragments: true, which gives every fragment its own page anyway.

Source

The repository ships a short, standalone starting point you can copy: example.qmd.

Back to top