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.
<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.
- containerFocusable region; arrow keys work while it has focus.
- bodyThe current slide, announced politely when it changes.
- 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
Props
Checked against the component's TypeScript type on every build.
| Name | Type | Default | Description |
|---|---|---|---|
| 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.
| Token | Tier | Value | Utility |
|---|---|---|---|
| card.radius | component | 16px | |
| focus | semantic | #C6492E | |
| spacing.3 | semantic | 12px | |
| spacing.4 | semantic | 16px | |
| spacing.8 | semantic | 32px | |
| surface.inverse | semantic | #0A0A0B | |
| surface.page | semantic | #FAFAF7 | |
| text.secondary | semantic | #555555 | |
| type.meta.size | semantic | 13px |
Accessibility
What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
| Check | How | Status |
|---|---|---|
| axe-core rules | Automated on every npm run check, at desktop and mobile width | Runs on every build |
| Keyboard | Automated Playwright test (scripts/keyboard.mjs) | Tested |
| Screen reader | Manual | Not tested yet |
Keyboard
| Key | Action |
|---|---|
| Tab | Moves focus to the deck, then to its buttons. |
| Arrow Right / Page Down / Space | Next slide. |
| Arrow Left / Page Up | Previous slide. |
| Home / End | First 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
| Pairing | Ratio (x:1) | Minimum | Status |
|---|---|---|---|
| text.secondary on surface.page | 7.13 | 4.5 | Pass |
| focus on surface.page | 4.57 | 3.0 | Pass |