Skip to content

Slides

SlideDeck

Shows one slide at a time with previous, next, arrow keys and full screen.

  • Experimental
  • Keyboard tested
  • Screen reader not tested yet

Playground

Change the props. The controls come from the documented props.

Design system

One system, many screens

Michael Lenz · free•lenz

Slide 1 of 2 · arrow keys while the deck has focus

tsx
<SlideDeck label="Example deck">
  <SlideTitle
    kicker="Design system"
    title="One system, many screens"
    byline="Michael Lenz · free•lenz"
  />
  <SlideNumber value="0" caption="screens built outside the system." />
</SlideDeck>

Usage

When to use

Use a deck to show slides one at a time on a page, for a talk in the browser or a showcase.

When not to use

  • For a printed or PDF hand-out: show the slides one under the other instead.

How it works

One slide at a time, Previous and Next below with the position. While the deck has focus, the arrow keys, Page Up and Down, Space, Home and End move through the slides. Full screen shows the deck on ink.

Content guidelines

The label is the talk's title. Keep the slides in the order of the talk; deepening slides go after the closing slide.

Do and don’t

Do
  • Put the deck first on its page, so the arrow keys work right after one Tab.
Don’t
  • Don't nest decks.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. containerFocusable region; arrow keys work while it has focus.
  2. bodyThe current slide, announced politely when it changes.
  3. actionsPrevious, Next, the position and Full screen.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { SlideDeck } from "@/ds";

Three slides

Design system · Showcase

free•lenz Design System

Michael Lenz · free•lenz

Slide 1 of 3 · arrow keys while the deck has focus

Props

Checked against the component's TypeScript type on every build.
SlideDeck props
NameTypeDefaultDescription
label (required)string–Names the deck, usually the talk title.
children (required)ReactNode–The slides, in order.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by SlideDeck
TokenTierValueUtility
card.radiuscomponent16px
focussemantic#C6492E
spacing.3semantic12px
spacing.4semantic16px
spacing.8semantic32px
surface.inversesemantic#0A0A0B
surface.pagesemantic#FAFAF7
text.secondarysemantic#555555
type.meta.sizesemantic13px

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Tested
Screen readerManualNot tested yet

Keyboard

SlideDeck keyboard interactions
KeyAction
TabMoves focus to the deck, then to its buttons.
Arrow Right / Page Down / SpaceNext slide.
Arrow Left / Page UpPrevious slide.
Home / EndFirst or last slide.

Semantics and focus

  • The deck is a focusable region with aria-roledescription “slide deck”.
  • Previous and Next are real buttons and disabled at the ends.

Contrast

SlideDeck contrast pairings
PairingRatio (x:1)MinimumStatus
text.secondary on surface.page7.134.5Pass
focus on surface.page4.573.0Pass