# Technical Documentation: FormidableLabs/spectacle

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/FormidableLabs/spectacle)

### Overview (README.md)

[](https://commerce.nearform.com/open-source/spectacle/)

<p align="center">
  <strong>✨ A ReactJS based Presentation Library ✨</strong>
  <br><br>
  <a href="https://npmjs.com/package/spectacle"><img src="https://img.shields.io/npm/dm/spectacle.svg"></a>
  <a href="https://npmjs.com/package/spectacle"><img src="https://img.shields.io/npm/v/spectacle.svg"></a>
  <a href="https://github.com/FormidableLabs/spectacle#maintenance-status">
    <img alt="Maintenance Status" src="https://img.shields.io/badge/maintenance-active-green.svg" />
  </a>
</p>

## Getting Started

Welcome to our monorepo project, housing the core [`spectacle` package](https://github.com/FormidableLabs/spectacle/blob/main/packages/spectacle/README.md) and related tools and examples.

Come learn more at our [docs site]!

## Support

Have a question about Spectacle? Submit an issue in this repository using the
["Question" template](https://github.com/FormidableLabs/spectacle/issues/new?template=question.md).

Notice something inaccurate or confusing? Feel free to [open an issue](https://github.com/FormidableLabs/spectacle/issues/new/choose) or [make a pull request](https://github.com/FormidableLabs/spectacle/pulls) to help improve the documentation for everyone!

The source for our docs site lives in this repo in the [`docs`](https://github.com/FormidableLabs/spectacle/blob/main/docs) folder.

## Contributing

Please see our [contributing guide](CONTRIBUTING.md).

## Maintenance Status

**Active:** Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.

[docs site]: https://commerce.nearform.com/open-source/spectacle/docs/

---

### Index (`docs/index.mdx`)

---
title: Introduction
order: 1
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import defaultDeckImg from '../website/static/img/default-deck.png'
import presenterModeImg from '../website/static/img/presenter-mode.png'
import animatedPresentationImg from '../website/static/img/presentation-mode.gif'

Spectacle is a React-based library for creating sleek presentations using React or Markdown that gives you the ability to live demo your code and use React libraries in your slides.

<img src={defaultDeckImg} style={{ width: '40rem'}} />

## How to get started with Spectacle


<Tabs>
  <TabItem value="spectacle-cli" label="Create Spectacle CLI" default>
  The fastest and easiest way to get started with Spectacle is to use the Create Spectacle CLI. This will create a new Spectacle project with a default deck and all the necessary dependencies.

  There are four different kinds of templates you can use to create your Spectacle project:

  1. ⚡️ **One Page** - A single HTML file using [htm](https://github.com/developit/htm) that self contains everything you need. Since it does not require a server to run your presentation, this is the recommended option for quickly spinning up a deck.
  2. 📄 **Markdown** - An app that uses Markdown for your presentation’s content with support for [Markdown Slide Layouts](md-slide-layouts). This is a React app that uses webpack and imports the Markdown content using Spectacle’s [`MarkdownSlideSet`](api-reference#markdown-components) component.
  3. 🏗️ **React using Vite** - An app that lets you build your presentation in React and uses Vite for building and running. This is the recommended option if you plan on using a number of additional npm libraries in your presentation.
  4. 🏗️ **React using webpack** - An app that lets you build your presentation in React and uses webpack for building and running.

  **To get started use `npx` or `pnpm dlx` to run the `create-spectacle` cli:**

  ```bash

  $ npx create-spectacle

  ```

  This will create a new Spectacle presentation in a directory of your deck’s name or one page file in the current directory.


  </TabItem>
  <TabItem value="autoPlay" label="Manual Installation" default>

  1. Install Spectacle by running `npm add spectacle`.

  2. In your main entry file, return the following Spectacle starter:

    ```tsx
    import { Deck, Slide, Heading, DefaultTemplate } from 'spectacle';

    function App() {
      return (
        <Deck template={<DefaultTemplate />}>
          <Slide>
            <Heading>Welcome to Spectacle</Heading>
          </Slide>
        </Deck>
      );
    }

    export default App;
    ```

    \:\:\:info

    If you are using NextJS with App Router, Spectacle needs to be rendered inside a client component. You can read more about this [here](https://nextjs.org/docs/app/building-your-application/rendering/client-components).

    \:\:\:


  </TabItem>
</Tabs>

## Presenter Mode

Spectacle also has a presenter mode that allows you to view your slides and notes on one screen while your audience views your slides on another. To use presenter mode, open a second browser window and visit your deck’s local server and enable it by using the key command. You can find more information about presentation controls [here](presenting-controls).

<img src={presenterModeImg} style={{ width: '40rem'}} />
<img src={animatedPresentationImg} style={{ width: '40rem'}} />


## Documentation, Contributing, and Source

For more information about Spectacle and its components, check out [the docs](https://commerce.nearform.com/open-source/spectacle).

Interested in helping out or seeing what's happening under the hood? Spectacle is maintained [on Github](https://github.com/FormidableLabs/spectacle) and you can [start contributing here](https://github.com/FormidableLabs/spectacle/blob/main/CONTRIBUTING.md).

For any questions, feel free to [open a new question on Github](https://github.com/FormidableLabs/spectacle/issues/new?template=question.md).

---

### Api Reference (`docs/api-reference.md`)

---
title: API Reference
order: 4
sidebar_position: 4
---

# API Reference

In Spectacle, presentations are composed of a set of base tags. We can separate these into three categories: [Main tags](#main-tags), [Typography tags](#typography-tags) & [Layout tags](#layout-tags).

## Main Tags

These are the bare bones of a Spectacle presentation, the two most essential tags you'll need to assemble a slideshow.

### Deck

Wraps the entire presentation and carries most of the overarching slide logic, like `theme` and `template` context.
A `template` contains Layout tags (referred to as a template render function) and is supplied to the `Deck` component to apply to all subsequent `Slide`s. The last three props are for print and export mode only, they have no effect on the audience or presenter views. The `pageSize` and `pageOrientation` props correspond to the size and orientation values for the [CSS media print size selector](https://developer.mozilla.org/en-US/docs/Web/CSS/@page/size). The `pageSize` is automatically set based on the deck theme slide size for a best-fit using export to PDF mode. If you need to print your deck, supply your paper size using the `pageSize` prop. The `printScale` is the ratio for the selected page size, orientation, and slide size. `0.958` is the best ratio for to ensure the PDF export fits the slide theme size. Currently, only Chrome and Chromium-based browsers fully implement the custom page size CSS media print specification. Other browsers such as Firefox and Safari can still export to PDF but the page size will not be a best fit.

| Props              | Type                                        | Default            |
|--------------------|---------------------------------------------|--------------------|
| `theme`            | [Styled-system theme object](./themes)      |                    |
| `template`         | [Templates](#templates)                     |                    |
| `pageSize`         | PropTypes.string                            | `"13.66in 7.68in"` |
| `pageOrientation`  | `"landscape"` or `"portrait"`               | `"landscape"`      |
| `printScale`       | PropTypes.number                            | `0.959`            |
| `autoPlay`         | PropTypes.bool                              | `false`            |
| `autoPlayLoop`     | PropTypes.bool                              | `false`            |
| `autoPlayInterval` | PropTypes.number (milliseconds)             | `1000`             |
| `transition`       | [**Transition**](./props#transition-object) | `slideTransition`  |
| `backgroundImage`  | PropTypes.string                            |                    |


### Slide

Wraps a single slide within your presentation; identifies what is contained to a single view. If a transition effect is applied to this slide, it will override the Deck-specified transition.

| Props                | Type                                        |
|----------------------|---------------------------------------------|
| `backgroundColor`    | PropTypes.string                            |
| `backgroundImage`    | PropTypes.string                            |
| `backgroundOpacity`  | PropTypes.number                            |
| `backgroundPosition` | PropTypes.string                            |
| `backgroundRepeat`   | PropTypes.string                            |
| `backgroundSize`     | PropTypes.string                            |
| `scaleRatio`         | PropTypes.number                            |
| `slideNum`           | PropTypes.number                            |
| `template`           | PropTypes.func                              |
| `textColor`          | PropTypes.string                            |
| `transition`         | [**Transition**](./props#transition-object) |

## Typography Tags

These tags are for displaying textual content.

| Tag Name            | Theme Props                                                                                                 | Additional Props           | Default Props                                                                                                                                                    |
|---------------------|-------------------------------------------------------------------------------------------------------------|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`Text`**          | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)       | —                          | **color**: primary<br /> **fontFamily**: text<br />**fontSize**: text<br />**textAlign**: left<br />**margin**: textMargin                                       |
| **`FitText`**       | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)       | —                          | **color**: primary<br /> **fontFamily**: text<br />**fontSize**: text<br />**textAlign**: center<br />**margin**: textMargin                                       |
| **`Heading`**       | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)       | —                          | **color**: secondary<br /> **fontFamily**: header<br />**fontSize**: h1<br />**fontWeight**: bold<br />**textAlign**: center<br />**margin**: headerMargin       |
| **`Link`**          | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)<br /> | **href**: PropTypes.string | **color**: quaternary<br /> **fontFamily**: text<br />**fontSize**: text<br />**textDecoration**: underline<br />**textAlign**: left<br />**margin**: textMargin |
| **`Quote`**         | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)<br /> | —                          | **color**: primary<br /> **fontFamily**: text<br />**fontSize**: text<br />**textAlign**: left<br />**borderLeft**: 1px solid secondary                          |
| **`OrderedList`**   | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)       | —                          | **color**: primary<br /> **fontFamily**: text<br />**fontSize**: text<br />**textAlign**: left<br />**margin**: listMargin                                       |
| **`UnorderedList`** | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)       | —                          | **color**: primary<br /> **fontFamily**: text<br />**fontSize**: text<br />**textAlign**: left<br />**margin**: listMargin                                       |
| **`ListItem`**      | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)       | —                          | **margin**: listMargin                                                                                                                                           |
| **`CodeSpan`**      | [**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)       | —                          | **fontFamily**: monospace<br />**fontSize**: text                                                                                                                |


## Templates

Templates are overlays that are present on every slide. Typically, they contain controls and deck progress. Spectacle contains a default template, shown below, ready to use that contains the full screen control and the animated progress dots. `<DefaultTemplate />` also supports customizing the color using the prop `color` and CSS color values such as `purple` or `#fff`.



```tsx
import { Deck, DefaultTemplate } from 'spectacle'

const Presentation = () => (
  <Deck theme={theme} template={<DefaultTemplate />}>
    {/* Your presentation here */}
  </Deck>
)
```

You can also create a custom template component. Props provided to the template component are:


| Props            | Type   | Description                            |
|------------------|--------|----------------------------------------|
| `slideNumber`    | number | The current index of the active slide. |
| `numberOfSlides` | number | The total count of slides in the deck. |

## Layout Tags

These tags are for adding structure to your slides.
A template render function consists of one or more Layout tags — it is supplied to the `Deck` component to apply to all subsequent `Slide`s.

| Tag Name      | Theme Props                                                                                                                                                                                               | Additional Props | Default Props     |
|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|-------------------|
| **`Box`**     | [**Space**](./props#space)<br />[**Color**](./props#color)<br />[**Layout**](./props#layout)<br />[**Position**](./props#position)<br /> [**Border**](./props#border)                                     | —                | —                 |
| **`FlexBox`** | [**Space**](./props#space)<br />[**Color**](./props#color)<br />[**Layout**](./props#layout)<br />[**Position**](./props#position)<br /> [**Border**](./props#border)<br />[**Flex**](./props#flex)<br /> | —                | —                 |
| **`Grid`**    | [**Layout**](./props#layout)<br />[**Position**](./props#position)<br />[**Grid**](./props#grid)<br />                                                                                                    | —                | **display**: grid |

## Table Tags

These tags are for adding tables with content to your slides.

| Tag Name          | Theme Props                                                                                                                                                               | Additional Props | Default Props                                                                                                                                       |
|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| **`Table`**       | [**Space**](./props#space)<br />[**Color**](./props#color)<br />[**Layout**](./props#layout)<br />[**Typography**](./props#typography)<br /> [**Border**](./props#border) | -                | **color**: primary<br />**fontFamily**: text<br />**fontSize**: text<br />**textAlign:** left<br />**margin**: listMargin                           |
| **`TableHeader`** | [**Space**](./props#space)<br />[**Color**](./props#color)<br />[**Layout**](./props#layout)<br />[**Typography**](./props#typography)<br /> [**Border**](./props#border) | -                | **color**: primary<br />**fontFamily**: text<br />**fontSize**: text<br />**fontWeight**: bold<br />**textAlign:** left<br />**margin**: listMargin |
| **`TableBody`**   | [**Space**](./props#space)<br />[**Color**](./props#color)<br />[**Layout**](./props#layout)<br />[**Typography**](./props#typography)<br /> [**Border**](./props#border) | -                | **color**: primary<br />**fontFamily**: text<br />**fontSize**: text<br />**textAlign:** left<br />**margin**: listMargin                           |
| **`TableRow`**    | [**Space**](./props#space)<br />[**Color**](./props#color)<br />[**Layout**](./props#layout)<br />[**Typography**](./props#typography)<br /> [**Border**](./props#border) | -                | **color**: primary<br />**fontFamily**: text<br />**fontSize**: text<br />**textAlign:** left<br />**margin**: listMargin                           |
| **`TableCell`**   | [**Space**](./props#space)<br />[**Color**](./props#color)<br />[**Layout**](./props#layout)<br />[**Typography**](./props#typography)<br /> [**Border**](./props#border) | -                | **color**: primary<br />**fontFamily**: text<br />**fontSize**: text<br />**textAlign:** left<br />**margin**: listMargin                           |

## useSteps

The `useSteps` hook allows a component to participate in the _slide step sequence_ for a given Slide.

NOTE: the vast majority of use cases are covered by the `Stepper` and `Appear` components documented below- in fact, they are implemented via this hook. The only case in which you may need to use this hook explicitly is if you need more precise control over a component in your presentation.

### Arguments and Options

- `numSteps` The first argument to this hook, `numSteps`, indicates how many steps your component will occupy in the slide step sequence. The second argument is an options object which accepts two options: `id` and `stepIndex`.
- `options.id`: _(For debugging and testing purposes only.)_ Allows you to customize the step sequence ID for this component.
- `options.priority`: Allows fine-grained control over the sequencing of multiple step sequence participants in a given Slide. By default, participants will be activated in the order in which they are rendered. However, this option allows you to specify a "priority"- for instance, a participant with `priority: -1` will run before any other participant, _regardless_ of render order.

### Return Values

This hook returns four values: `stepId`, `isActive`, `step`, and `placeholder`.

- `stepId`: _(For debugging and testing purposes only.)_ Either the `id` option passed into the hook, or a randomly-generated ULID.
- `step`: the _relative_ step within this participant's step sequence. Before the slide has reached this participant, this value is `-1`. When the slide reaches this stepper, it will increase at each step until it reaches `numSteps - 1`, and will remain there after the slide step has 'passed' it.
- `isActive`: Boolean value indicating whether the slide step sequence has reached this participant. Equivalent to the expression `step >= 0`.
- `placeholder`: DOM node which _must_ be rendered by the consumer component- this is how a Slide detects step sequence participants.

## Stepper

`<Stepper>` is a thin wrapper around `useSteps`. The length of its `values` list indicates the number of steps it occupies in the slide step sequence. Each of these values are passed in turn to the render function you provide. Additionally, it allows you to specify styles which should be applied before and after it is activated, and uses `react-spring` to interpolate between the 'active style' and the 'inactive style'.

The render function you provide (either via the `render` prop or as a '`children` function') is called with three arguments:

- The element of the list passed to `values` which corresponds to the current step (or `undefined` if the Stepper is inactive)
- The current step _relative_ to this Stepper's sequence (which will be `-1` if the Stepper is inactive)
- A boolean value (`isActive`) indicating whether the Stepper is active.

For instance, suppose we render a slide like this:

```jsx
<Slide>
  <p>Hello, world!</p>
  <Stepper tagName="p" alwaysVisible values={['foo', 'bar']}>
    {(value, step, isActive) =>
      isActive
        ? `The first stepper is active. Step: ${step} Value: ${value}`
        : `The first stepper is not active. Step: ${step} Value: ${value}`
    }
  </Stepper>
  <Stepper tagName="p" alwaysVisible values={['baz', 'quux']}>
    {(value, step, isActive) =>
      isActive
        ? `The second stepper is active. Step: ${step} Value: ${value}`
        : `The second stepper is not active. Step: ${step} Value: ${value}`
    }
  </Stepper>
</Slide>
```

The following output will be rendered as you step through the slide:

```html

<p>Hello, world!</p>
<p>The first stepper is not active. Step: -1 Value: undefined</p>
<p>The second stepper is not active. Step: -1 Value: undefined</p>


<p>Hello, world!</p>
<p>The first stepper is active. Step: 0 Value: foo</p>
<p>The second stepper is not active. Step: -1 Value: undefined</p>


<p>Hello, world!</p>
<p>The first stepper is active. Step: 1 Value: bar</p>
<p>The second stepper is not active. Step: -1 Value: undefined</p>


<p>Hello, world!</p>
<p>The first stepper is active. Step: 1 Value: bar</p>
<p>The second stepper is active. Step: 0 Value: baz</p>


<p>Hello, world!</p>
<p>The first stepper is active. Step: 1 Value: bar</p>
<p>The second stepper is active. Step: 0 Value: baz</p>


<p>Hello, world!</p>
<p>The first stepper is active. Step: 1 Value: bar</p>
<p>The second stepper is active. Step: 1 Value: quux</p>
```

### Props

- `id`: _(For debugging and testing purposes only)_ Passed to `useSteps`.
- `priority`: Passed to `useSteps`.
- `render`: Render function (see above.)
- `children`: Render function (see above.)
- `className`: Class name applied to the animated container element.
- `tagName`: Tag which will be used as the animated container element. Defaults to `div`.
- `values`: Values array (see description above).
- `alwaysVisible`: Forces this stepper to always have its active style applied.
- `activeStyle`: Style object applied when this `<Stepper>` is active. Defaults to `{ opacity: 1 }`.
- `inactiveStyle`: Style object applied when this `<Stepper>` is inactive. Defaults to `{ opacity: 0 }`.

## Appear

Appear is a thin wrapper around `useSteps`. It occupies a single step within the slide step sequence. It wraps its child elements in an animated container element, and uses `react-spring` to interpolate between its `activeStyle` and `inactiveStyle`.

### Props

- `id`: _(For debugging and testing purposes only)_ Passed to `useSteps`.
- `priority`: Passed to `useSteps`.
- `children`: Children rendered within this `Appear`.
- `className`: Class name applied to the animated container element.
- `tagName`: Tag which will be used as the animated container element. Defaults to `div`.
- `activeStyle`: Style object applied when this `<Appear>` is active. Defaults to `{ opacity: 1 }`.
- `inactiveStyle`: Style object applied when this `<Appear>` is inactive. Defaults to `{ opacity: 0 }`.

## Code Pane

CodePane is a component for showing a syntax-highlighted block of source code. It will scroll for overflow amounts of code, trim whitespace and normalize indents. It will also wrap long lines of code and preserve the indent. CodePane uses the [React Syntax Highlighter](https://github.com/react-syntax-highlighter/react-syntax-highlighter) Component.

The `theme` prop accepts a configurable object or pre-defined theme object from the available [Prism Themes](https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/src/styles/prism/index.js). These themes are conveniently exported from Spectacle as `codePaneThemes`.

Additionally, the `highlightRanges` prop accepts an array that can be used to highlight certain ranges of code:

This array can contain a range of two numbers, where the first number indicates the _start_, and the second number the _end_ of that range, e.g.,

`[1, 3]` will highlight lines 1 through 3.

It can also contain a list of sub-arrays which will be considered as a list of ranges, e.g.,

`[[1, 3], [6, 8], [10, 15]]`.

Array values can even be mixed to include sub-arrays (for multiple lines) and numbers (for single lines), e.g.,

`[[1, 3], 5, [6, 8], [10, 15], 20]`.

_Note that each range will be considered as a step in your current slide's animation. Each range will be highlighted as you move forward or backwards on each step._

| Props                              | Type                                                                                          | Example                                                                                                                   | Default Props        |
|------------------------------------|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|----------------------|
| `children`                         | PropTypes.string                                                                              | `let name = "Carlos"`                                                                                                     | -                    |
| `highlightRanges`                  | PropTypes.arrayOf(PropTypes.number) or PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)) | `[1, 3]` or `[[6, 8], [10, 15]]`                                                                                          | -                    |
| `language`                         | PropTypes.string                                                                              | `javascript`                                                                                                              | -                    |
| `theme`                            | PropTypes.object or                                                                           | [Prism Theme](https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/src/styles/prism/index.js) | vs-dark Theme Object |
| `showLineNumbers`                  | PropTypes.bool                                                                                | `true`, `false`                                                                                                           | `true`               |
| [**`Layout`**](./props#layout)     |                                                                                               |                                                                                                                           |                      |
| [**`Position`**](./props#position) |                                                                                               |                                                                                                                           |                      |

```jsx
import tomorrow from 'react-syntax-highlighter/dist/cjs/styles/prism/tomorrow';

() => (
  <Slide>
    <CodePane language="javascript" theme={tomorrow} highlightRanges={[1, 3]}>
      {`
      const App = () => (
        <Provider value={client}>
          <Todos />
        </Provider>
      );
      `}
    </CodePane>
  </Slide>
);
```

## FullScreen

FullScreen is a button that takes the presentation in and out of the browser's full screen mode. It can have a different color and be re-sized.

| Props                              | Type             | Example   |
|------------------------------------|------------------|-----------|
| `size`                             | PropTypes.number | `23`      |
| `color`                            | PropTypes.string | `#abc123` |
| [**`Position`**](./props#position) |                  |           |

## Image

Image is a component to display a picture within a slide. It is analogous to an `<img>` tag and conforms to Layout and Position props.

| Props                              | Type             |
|------------------------------------|------------------|
| src                                | PropTypes.string |
| [**`Layout`**](./props#layout)     |                  |
| [**`Position`**](./props#position) |                  |

## Markdown Components

The Markdown components let you include a block of Markdown within a slide using `<Markdown />`, author a complete slide with Markdown using `<MarkdownSlide />`, or author a series of slides with Markdown using `<MarkdownSlides />`. Markdown tags get converted into Spectacle components. The `---` three dash marker when used inside `<MarkdownSlideSet />` is used to divide content into separate slides. Markdown also supports presenter notes using the `Notes:` marker. `<Markdown />` must be a child of `<Slide />` where `<MarkdownSlide />` and `<MarkdownSlideSet />` are children of `<Deck />`.

| Props                              | Type              | Example                                                                             |
|------------------------------------|-------------------|-------------------------------------------------------------------------------------|
| `children`                         | PropTypes.string  | `# Hi there`                                                                        |
| `componentProps`                   | PropTypes.object  | `<MarkdownSlide componentProps={{ color: 'purple' }}># I'm purple!</MarkdownSlide>` |
| `animateListItems`                 | PropTypes.boolean | `<MarkdownSlide animateListItems />`                                                |
| [**`Layout`**](./props#layout)     |                   |                                                                                     |
| [**`Position`**](./props#position) |                   |                                                                                     |

```jsx
<Slide>
  <Markdown>
    # Urql
    A highly customizable and versatile GraphQL client
  </Markdown>
  <Text>Made by Formidable</Text>
</Slide>
<MarkdownSlide animateListItems>
  # Use Markdown to write a slide

  This is a single slide composed using Markdown.

  - It uses the `animateListItems` prop so...
  - it's list items...
  - will animate in, one at a time.
</MarkdownSlide>
<MarkdownSlideSet>
  # Markdown Slide Sets

  Let you write a sequence of slides using Markdown.

  ---

  # This is the Second Slide in the Set

  Using the `---` delimiter creates a new slide in the set.

  Notes: The easiest way to always display up-to-date data is to set the requestPolicy to 'cache-and-network'.
</MarkdownSlideSet>
```

#### v7 Migration Guide

In prior versions of Spectacle the `<Markdown />` component was used for slides, set and markdown content. As noted above there are now three specific components for each of these use cases.

1. `<Slide><Markdown /></Slide>` remains the same.
2. `<Markdown />` when used for a full slide is now `<MarkdownSlide />`.
3. `<Markdown containsSlides />` is now `<MarkdownSlideSet />`.

## Notes

Notes is a component that only renders in Presenter mode as presenter notes. It is used as the last component inside your slide but does not show on the deck.

| Props      | Type             | Example           |
|------------|------------------|-------------------|
| `children` | PropTypes.string | `Presenter Notes` |

```jsx
<Slide>
  <Heading>Urql</Heading>
  <Text>A highly customizable and versatile GraphQL client</Text>
  <Notes>
    Urql is a GraphQL client that exposes a set of React components and hooks.
  </Notes>
</Slide>
```

## Progress

Progress is a component with no children that just shows dots for each slide in your deck. The current slide is represented by a filled circle. Visited and future slides are represented by a transparent, outlined circle. The size and color are customizable.

| Props                              | Type             | Example   |
|------------------------------------|------------------|-----------|
| `size`                             | PropTypes.number | `23`      |
| `color`                            | PropTypes.string | `#abc123` |
| [**`Position`**](./props#position) |                  |           |

## AnimatedProgress

AnimatedProgress is similar to the Progress component, with an additional Pacman character that moves when the current slide changes. It looks like the Pacman is eating all of the circles that represent slides up to, and including, the new current slide. The size and color of the circles are customizable, as is the color of the Pacman.

| Props                              | Type             | Example   |
|------------------------------------|------------------|-----------|
| `size`                             | PropTypes.number | `23`      |
| `color`                            | PropTypes.string | `#abc123` |
| `pacmanColor`                      | PropTypes.string | `#abc123` |
| [**`Position`**](./props#position) |                  |           |

---

### Extensions (`docs/extensions.md`)

---
title: Extensions
order: 9
sidebar_position: 9
---

# Third Party Extensions

In the past, developers across the open-source-iverse have created extensions for use within your Spectacle presentation.

Since the [release of v6](https://github.com/FormidableLabs/spectacle/releases/tag/v6.0.0), the previously developed extensions are no longer compatible with the latest and greatest in Spectacle. We hope that changes soon, and we are happy to support you...

- ... in updating your project if you're one of the folks with a now-deprecated tool.
- ... with PR review and feedback if you're interested in writing a new tool and don't know where to start.

To see a list of the extensions we've listed here in the past, please check out [the archive in git](https://github.com/FormidableLabs/spectacle/blob/3fd0e850ebab65758b1a4db04c8edef5f2cee81e/docs/content/extensions.md).

# Formidable Extensions

There are a few companion projects that Formidable directly maintains.

## spectacle-cli

A collection of tools for serving or generating new presentation decks. Includes `spectacle` and `spectacle-boilerplate`.

For complete documentation of the CLI, please check out [the repository](https://www.github.com/FormidableLabs/spectacle-cli).

## spectacle-mdx-loader

A webpack MDX loader for Spectacle presentations.

Check [the repository](https://github.com/FormidableLabs/spectacle/tree/main/packages/spectacle-mdx-loader) for usage, integration, and more information.

---

### Faq (`docs/faq.md`)

---
title: FAQ
order: 10
sidebar_position: 10
---

# Frequently Asked Questions

## Can I export my slides for use elsewhere?

Yes - you can export your slides in PDF format. Appending your presentation URL with `?exportMode=true` will allow you to export your presentation by flattening out your presentation so that you can Print to PDF directly from your browser. 🎉

If you want a black & white version of your slides printed to PDF, append your URL with `?exportMode=true&printMode=true` to get a printer-friendly, flattened, black & white print out of your slideshow.

For more info about the query parameters Spectacle supports, please check out our section about it in the [presenting controls documentation](./presenting-controls#query-parameters).

## Can I write my presentation in TypeScript?

Yes—Spectacle types are shipped with the package, so you can safely use Spectacle in any `.ts` or `.js` presentation without a separate type definition import. TypeScript is now the default language for Spectacle and the `create-spectacle` CLI, so you can use it without any additional configuration.

---

### Md Slide Layouts (`docs/md-slide-layouts.md`)

---
title: Markdown Slide Layouts
order: 7
sidebar_position: 7
---

# Markdown Slide Layouts

Spectacle supports a number of layout containers for use in your Markdown slides. These containers are designed to enable more complex layouts previously not doable in Markdown without the usage of importing JSX elements into MDX.

Spectacle uses `---` (three dashes) to delimit each slide in a Markdown file. Spectacle adds supports for a JSON-based configuration object with the slide delimiter in your Markdown file. This configuration object is used to define the layout of the slide. Currently, two types of layouts are support are `center` and `columns`.

:::info

Markdown-annotated slide layouts is available only with `.md` files. This feature is not available with `.mdx` files where you can use JSX-based layout primitives.

:::

## Columns Layout

The columns layout is used to create a row-based column layout. The columns layout is defined by the following JSON object:

```json
{ "layout" : "columns" }
```

Each column section is defined by a `::section` delimiter. The number of columns is determined by the number of `::section` annotations.



```md

--- { "layout" : "columns" }

::section



::section



---

# Ghost-type Pokémon

The Ghost-type (ゴーストタイプ Gosuto taipu in Japanese) is one of the eighteen Pokémon elemental types.

```

This layout has the underlying JSX structure and divides each section into an array:

```jsx
<FlexBox flexDirection="row" alignItems="start" flex={1}>
  {sectionsArray}
</FlexBox>
```

## Center Layout

The center layout is used to create a single column layout with the content centered. The center layout is defined by the following JSON object:

```json
{ "layout" : "center" }
```



```md

--- { "layout" : "center" }



---

# Gengar

Gengar is a dark purple, bipedal Pokémon with a roundish body. It has red eyes and a wide mouth that is usually curled into a sinister grin. Multiple spikes cover its back, and it has large pointed ears. Its arms and legs are short with three digits on both its hands and feet. It also has a stubby tail.

```

This layout has the underlying JSX structure and passes all the slide content as chidren:

```jsx
<FlexBox justifyContent="center" alignItems="center" height="100%">
  {content}
</FlexBox>
```

---

### Presenting Controls (`docs/presenting-controls.mdx`)

---
title: Presenting Controls
order: 2
sidebar_position: 2
---

import commandBarImage from "../website/static/img/command-bar.png"

# Presenting Controls

Spectacle comes with a few keyboard shortcuts to help you navigate your presentation. These shortcuts are available in both the browser and the Presenter Mode. You can also use the command bar to see all available shortcuts.

## Command Bar

Pressing <kbd>&#8984;</kbd>/<kbd>Ctrl</kbd> + <kbd>k</kbd> will open the command bar. This will show you all available keyboard shortcuts and common navigation options.

<img src={commandBarImage} alt="Command Bar interface" style={{ width: "30rem" }} />


## Keyboard Controls

| Key Combination | Function               |
| --------------- | ---------------------- |
| <kbd aria-label="Arrow Right Key">&#8594;</kbd>     | Next Slide             |
| <kbd>&#8592;</kbd>      | Previous Slide         |
| <kbd>&#8997;</kbd>/<kbd>Alt</kbd> + <kbd>&#8679;</kbd> + <kbd>O</kbd>  | Toggle Overview Mode   |
| <kbd>&#8997;</kbd>/<kbd>Alt</kbd> + <kbd>&#8679;</kbd> + <kbd>P</kbd>  | Toggle Presenter Mode  |
| <kbd>&#8997;</kbd>/<kbd>Alt</kbd> + <kbd>&#8679;</kbd> + <kbd>F</kbd>  | Toggle Fullscreen Mode |

## Query Parameters

A handful of query parameters are supported within your Spectacle presentation.
Append your URL with one of the following parameters, like so: `&<parameter>=true`.
To combine parameters, use multiple `&` to separate the parameters, e.g.: `&exportMode=true&printMode=true`

| Parameter       | Description of Use                                                                                                                                        |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `exportMode`    | For exporting your presentation as a PDF. Add it to your project URL and "Save to PDF" directly from the browser                                          |
| `printMode`     | Turns your slideshow into a printer-friendly, black & white version. Meant for use concurrently with `?exportMode` e.g. `?exportMode=true&printMode=true` |
| `presenterMode` | Displays a Presenter Mode with slide notes, a timer, and the upcoming slide.         |

---

### Props (`docs/props.md`)

---
title: Base Props
order: 5
sidebar_position: 5
---

# Base Props

The following are a handful of standard base props many components consume. For a complete list of available components and the props they consume, please see our complete [API Reference](./api-reference.md).

## Transition Object

A transition object defines the animatable CSS properties for three states: `from`, `enter`, and `leave`. From is the starting transition. Enter are the styles applied when the slide is in view. Leave are the styles when the slide goes out of view.

An example transition object looks like:

```javascript
const transition = {
  from: {
    opacity: 0,
    transform: 'rotate(45deg)'
  },
  enter: {
    opacity: 1,
    transform: 'rotate(0)'
  },
  leave: {
    opacity: 0,
    transform: 'rotate(315deg)'
  }
};
```

## Background

**Background** props used by [`Slide`](./api-reference.md#slide).

| Name                 | PropType         | Description                  | Example                        |
| -------------------- | ---------------- | ---------------------------- | ------------------------------ |
| `backgroundImage`    | PropTypes.string | Set CSS `backgroundImage`    | `url('...')` or `require(...)` |
| `backgroundSize`     | PropTypes.string | Set CSS `backgroundSize`     | `cover`                        |
| `backgroundPosition` | PropTypes.string | Set CSS `backgroundPosition` | `center`                       |
| `backgroundRepeat`   | PropTypes.string | Set CSS `backgroundRepeat`   | `no-repeat`                    |

## Color

**Color** props are used by [`CodeSpan`](./api-reference.md#typography-tags), [`Text`](./api-reference.md#typography-tags), [`Link`](./api-reference.md#typography-tags), [`Heading`](./api-reference.md#typography-tags), [`Quote`](./api-reference.md#typography-tags), [`Table`](./api-reference.md#table-tags), [`TableHeader`](./api-reference.md#table-tags), [`TableBody`](./api-reference.md#table-tags), [`TableRow`](./api-reference.md#table-tags), [`TableCell`](./api-reference.md#table-tags), [`UnorderedList`](./api-reference.md#typography-tags), [`OrderedList`](./api-reference.md#typography-tags), and [`ListItem`](./api-reference.md#typography-tags).

| Name                      | PropType         | Description                                             | Example                  |
| ------------------------- | ---------------- | ------------------------------------------------------- | ------------------------ |
| `color`                   | PropTypes.string | Set CSS `color` value or `color` theme value            | `#abc123` or `primary`   |
| `bg` or `backgroundColor` | PropTypes.string | Set CSS `background-color` value or `color` theme value | `#abc123` or `secondary` |

## Space

**Space** props used by [`Box`](./api-reference.md#layout-tags), [`FlexBox`](./api-reference.md#layout-tags), [`Grid`](./api-reference.md#layout-tags), [`CodeSpan`](./api-reference.md#typography-tags), [`Text`](./api-reference.md#typography-tags), [`Link`](./api-reference.md#typography-tags), [`Heading`](./api-reference.md#typography-tags), [`Quote`](./api-reference.md#typography-tags), [`Table`](./api-reference.md#table-tags), [`TableHeader`](./api-reference.md#table-tags), [`TableBody`](./api-reference.md#table-tags), [`TableRow`](./api-reference.md#table-tags), [`TableCell`](./api-reference.md#table-tags), [`UnorderedList`](./api-reference.md#typography-tags), [`OrderedList`](./api-reference.md#typography-tags), and [`ListItem`](./api-reference.md#typography-tags).

| Name                    | PropType         | Description                                                             | Example                             |
| ----------------------- | ---------------- | ----------------------------------------------------------------------- | ----------------------------------- |
| `m` or `margin`         | PropTypes.string | Set CSS `margin` value or `space` theme value                           | `24px`, `6px 3px 2px`, or `primary` |
| `mt` or `marginTop`     | PropTypes.string | Set CSS `margin-top` value or `space` theme value                       | `1em` or `tertiary`                 |
| `mr` or `marginRight`   | PropTypes.string | Set CSS `margin-right` value or `space` theme value                     | `0.5em` or `secondary`              |
| `mb` or `marginBottom`  | PropTypes.string | Set CSS `margin-bottom` value or `space` theme value                    | `2px` or `primary`                  |
| `ml` or `marginLeft`    | PropTypes.string | Set CSS `margin-left` value or `space` theme value                      | `3%` or `secondary`                 |
| `mx` or `marginX`       | PropTypes.string | Set CSS `margin-left` and `margin-right` value or `space` theme value   | `1em` or `secondary`                |
| `my` or `marginY`       | PropTypes.string | Set CSS `margin-top` and `margin-bottom` value or `space` theme value   | `5px` or `tertiary`                 |
| `p` or `padding`        | PropTypes.string | Set CSS `padding` value or `space` theme value                          | `24px`, `6px 3px 2px`, or `primary` |
| `pt` or `paddingTop`    | PropTypes.string | Set CSS `padding-top` value or `space` theme value                      | `1em` or `tertiary`                 |
| `pr` or `paddingRight`  | PropTypes.string | Set CSS `padding-right` value or `space` theme value                    | `0.5em` or `secondary`              |
| `pb` or `paddingBottom` | PropTypes.string | Set CSS `padding-bottom` value or `space` theme value                   | `2px` or `primary`                  |
| `pl` or `paddingLeft`   | PropTypes.string | Set CSS `padding-left` value or `space` theme value                     | `3%` or `secondary`                 |
| `px` or `paddingX`      | PropTypes.string | Set CSS `padding-left` and `padding-right` value or `space` theme value | `1em` or `secondary`                |
| `py` or `paddingY`      | PropTypes.string | Set CSS `padding-top` and `padding-bottom` value or `space` theme value | `5px` or `tertiary`                 |

## Typography

**Typography** props are used by [`CodeSpan`](./api-reference.md#typography-tags), [`Text`](./api-reference.md#typography-tags), [`Link`](./api-reference.md#typography-tags), [`Heading`](./api-reference.md#typography-tags), [`Quote`](./api-reference.md#typography-tags), [`Table`](./api-reference.md#table-tags), [`TableHeader`](./api-reference.md#table-tags), [`TableBody`](./api-reference.md#table-tags), [`TableRow`](./api-reference.md#table-tags), [`TableCell`](./api-reference.md#table-tags), [`UnorderedList`](./api-reference.md#typography-tags), [`OrderedList`](./api-reference.md#typography-tags), and [`ListItem`](./api-reference.md#typography-tags).

| Name            | PropType         | Description                                                    | Example                                                |
| --------------- | ---------------- | -------------------------------------------------------------- | ------------------------------------------------------ |
| `fontFamily`    | PropTypes.string | Set CSS `font-family` value or `fonts` theme value             | `Helvetica` or `primary`                               |
| `fontSize`      | PropTypes.string | Set CSS `font-size` value or `fontSizes` theme value           | `16px` or `bodyCopy`                                   |
| `fontWeight`    | PropTypes.string | Set CSS `font-weight` value or `fontWeights` theme value       | `400`, `bold`, or [`Heading`](./api-reference.md#typography-tags) |
| `lineHeight`    | PropTypes.string | Set CSS `line-height` value or `fontWeights` theme value       | `1.5em` or `paragraph`                                 |
| `letterSpacing` | PropTypes.string | Set CSS `letter-spacing` value or `letterSpacings` theme value | `1px` or `spreadOutText`                               |
| `textAlign`     | PropTypes.string | Set CSS `text-align` value                                     | `left`                                                 |
| `fontStyle`     | PropTypes.string | Set CSS `font-style` value                                     | `normal` or `italic`                                   |

## Layout

**Layout** props are used by [`Box`](./api-reference.md#layout-tags), [`FlexBox`](./api-reference.md#layout-tags), [`Grid`](./api-reference.md#layout-tags), [`Table`](./api-reference.md#table-tags), [`TableHeader`](./api-reference.md#table-tags), [`TableBody`](./api-reference.md#table-tags), [`TableRow`](./api-reference.md#table-tags), [`TableCell`](./api-reference.md#table-tags), [`CodePane`](./api-reference.md#code-pane), and [`Markdown`](./api-reference.md#markdown-components).

| Name        | PropType                             | Description                                                                                                                                                                              | Example                                    |
| ----------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| `width`     | PropTypes.string or PropTypes.number | Set CSS `width` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels              | `100%`, `1/2`, `30px`, `256`, or `primary` |
| `height`    | PropTypes.string or PropTypes.number | Set CSS `height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels             | `100%`, `1/2`, `30px`, `256`, or `primary` |
| `minWidth`  | PropTypes.string or PropTypes.number | Set CSS `min-width` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels          | `100%`, `1/2`, `30px`, `256`, or `primary` |
| `maxWidth`  | PropTypes.string or PropTypes.number | Set CSS `max-width` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels          | `100%`, `1/2`, `30px`, `256`, or `primary` |
| `minHeight` | PropTypes.string or PropTypes.number | Set CSS `min-height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels         | `100%`, `1/2`, `30px`, `256`, or `primary` |
| `maxHeight` | PropTypes.string or PropTypes.number | Set CSS `max-height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels         | `100%`, `1/2`, `30px`, `256`, or `primary` |
| `size`      | PropTypes.string or PropTypes.number | Set CSS `width` and `height` value or `sizes` theme value, fractional numeric values get converted to percents, for example `1/2` becomes `50%`, whole numbers get converted into pixels | `100%`, `1/2`, `30px`, `256`, or `primary` |
| `display`   | PropTypes.string                     | Set CSS `display` value                                                                                                                                                                  | `inline-block`                             |
| `overflow`  | PropTypes.string                     | Set CSS `overflow` value                                                                                                                                                                 | `visible`                                  |
| `overflowX` | PropTypes.string                     | Set CSS `overflow-x` value                                                                                                                                                               | `hidden`                                   |
| `overflowY` | PropTypes.string                     | Set CSS `overflow-y` value                                                                                                                                                               | `visible`                                  |

## Flex

**Flex** props are used by [`FlexBox`](./api-reference.md#layout-tags).

| Name             | PropType                             | Description                     | Example         |
| ---------------- | ------------------------------------ | ------------------------------- | --------------- |
| `alignItems`     | PropTypes.string                     | Set CSS `align-items` value     | `flex-start`    |
| `alignContent`   | PropTypes.string                     | Set CSS `align-content` value   | `center`        |
| `justifyContent` | PropTypes.string                     | Set CSS `justify-content` value | `space-between` |
| `flexWrap`       | PropTypes.string                     | Set CSS `flex-wrap` value       | `wrap`          |
| `flexBasis`      | PropTypes.string or PropTypes.number | Set CSS `flex-basis` value      | `auto` or `1`   |
| `flexDirection`  | PropTypes.string                     | Set CSS `flex-direction` value  | `column`        |
| `flex`           | PropTypes.string                     | Set CSS `flex` value            | `1 1 auto`      |
| `justifySelf`    | PropTypes.string                     | Set CSS `justify-self` value    | `stretch`       |
| `alignSelf`      | PropTypes.string                     | Set CSS `align-self` value      | `center`        |
| `order`          | PropTypes.number                     | Set CSS `order` value           | `1`             |

## Grid

**Grid** props are used by [`Grid`](./api-reference.md#layout-tags).

| Name                  | PropType                             | Description                           | Example                                       |
| --------------------- | ------------------------------------ | ------------------------------------- | --------------------------------------------- |
| `gridGap`             | PropTypes.number                     | Set CSS `grid-gap` value              | `15`                                          |
| `gridColumnGap`       | PropTypes.number                     | Set CSS `grid-column-gap` value       | `3`                                           |
| `gridRowGap`          | PropTypes.number                     | Set CSS `grid-row-gap` value          | `6`                                           |
| `gridColumn`          | PropTypes.number or PropTypes.string | Set CSS `grid-column` value           | `auto`, `1 / 2`, or `3`                       |
| `gridRow`             | PropTypes.number or PropTypes.string | Set CSS `grid-row` value              | `auto`, `1 / 2`, or `3`                       |
| `gridAutoFlow`        | PropTypes.string                     | Set CSS `grid-auto-flow` value        | `row` or `column-dense`                       |
| `gridAutoColumns`     | PropTypes.string                     | Set CSS `grid-auto-columns` value     | `min-content`, `1fr`, or `minmax(10px, auto)` |
| `gridAutoRows`        | PropTypes.string                     | Set CSS `grid-auto-rows` value        | `min-content`, `1fr`, or `minmax(10px, auto)` |
| `gridTemplateColumns` | PropTypes.string                     | Set CSS `grid-template-columns` value | `60px 60px` or `1fr 2fr`                      |
| `gridTemplateRows`    | PropTypes.string                     | Set CSS `grid-template-rows` value    | `40px 1fr` or `8ch auto`                      |
| `gridTemplateAreas`   | PropTypes.string                     | Set CSS `grid-template-area` value    | `a b` or `inherit`                            |
| `gridArea`            | PropTypes.string                     | Set CSS `grid-area` value             | `a` or `2 / 1 / 4`                            |

## Position

**Position** props are used by [`Box`](./api-reference.md#layout-tags), [`FlexBox`](./api-reference.md#layout-tags), [`Grid`](./api-reference.md#layout-tags), [`CodePane`](./api-reference.md#typography-tags), [`FullScreen`](./api-reference.md#fullscreen), [`Progress`](./api-reference.md#progress), [`AnimatedProgress`](./api-reference.md#animatedprogress), and [`Markdown`](./api-reference.md#markdown-components).

| Name       | PropType         | Description              | Example    |
| ---------- | ---------------- | ------------------------ | ---------- |
| `position` | PropTypes.string | Set CSS `position` value | `relative` |
| `zIndex`   | PropTypes.number | Set CSS `z-index` value  | `2`        |
| `top`      | PropTypes.number | Set CSS `top` value      | `1`        |
| `right`    | PropTypes.number | Set CSS `right` value    | `3`        |
| `bottom`   | PropTypes.number | Set CSS `bottom` value   | `10`       |
| `left`     | PropTypes.number | Set CSS `left` value     | `5`        |

## Border

**Border** props are used by [`Box`](./api-reference.md#layout-tags), [`FlexBox`](./api-reference.md#layout-tags), [`Grid`](./api-reference.md#layout-tags), [`Table`](./api-reference.md#table-tags), [`TableHeader`](./api-reference.md#table-tags), [`TableBody`](./api-reference.md#table-tags), [`TableRow`](./api-reference.md#table-tags), and [`TableCell`](./api-reference.md#table-tags).

| Name                      | PropType                             | Description                                    | Example              |
| ------------------------- | ------------------------------------ | ---------------------------------------------- | -------------------- |
| `border`                  | PropTypes.string                     | Set CSS `position` value                       | `2px solid white`    |
| `borderWidth`             | PropTypes.number or PropTypes.string | Set CSS `border-width` value                   | `5px`                |
| `borderStyle`             | PropTypes.string                     | Set CSS `border-style` value                   | `solid`              |
| `borderColor`             | PropTypes.string                     | Set CSS `border-color` value                   | `rgb(255, 200, 150)` |
| `borderRadius`            | PropTypes.number or PropTypes.string | Set CSS `border-radius` value                  | `10`                 |
| `borderTop`               | PropTypes.string                     | Set CSS `border-top` value                     | `3px dashed #000`    |
| `borderTopWidth`          | PropTypes.number or PropTypes.string | Set CSS `border-top-width` value               | `1`                  |
| `borderTopStyle`          | PropTypes.string                     | Set CSS `border-top-style` value               | `solid`              |
| `borderTopColor`          | PropTypes.string                     | Set CSS `border-top-color` value               | `#ff0abc`            |
| `borderTopLeftRadius`     | PropTypes.number or PropTypes.string | Set CSS `border-top-left-radius` value         | `20%`                |
| `borderTopRightRadius`    | PropTypes.number or PropTypes.string | Set CSS `border-top-right-radius` value        | `4px`                |
| `borderRight`             | PropTypes.string                     | Set CSS `border-right` value                   | `relative`           |
| `borderRightWidth`        | PropTypes.number or PropTypes.string | Set CSS `border-right-width` value             | `1px`                |
| `borderRightStyle`        | PropTypes.string                     | Set CSS `border-right-style` value             | `solid`              |
| `borderRightColor`        | PropTypes.string                     | Set CSS `border-right-color` value             | `red`                |
| `borderBottom`            | PropTypes.string                     | Set CSS `border-bottom` value                  | `2px solid blue`     |
| `borderBottomWidth`       | PropTypes.number or PropTypes.string | Set CSS `border-bottom-width` value            | `1em`                |
| `borderBottomStyle`       | PropTypes.string                     | Set CSS `border-bottom-style` value            | `dashed`             |
| `borderBottomColor`       | PropTypes.string                     | Set CSS `border-bottom-color` value            | `orange`             |
| `borderBottomLeftRadius`  | PropTypes.number or PropTypes.string | Set CSS `border-bottom-left-radius` value      | `2px`                |
| `borderBottomRightRadius` | PropTypes.number or PropTypes.string | Set CSS `border-bottom-right-radius` value     | `4px`                |
| `borderLeft`              | PropTypes.string                     | Set CSS `border-left` value                    | `1px solid green`    |
| `borderLeftWidth`         | PropTypes.number or PropTypes.string | Set CSS `border-left-width` value              | `2px`                |
| `borderLeftStyle`         | PropTypes.string                     | Set CSS `border-left-style` value              | `solid`              |
| `borderLeftColor`         | PropTypes.string                     | Set CSS `border-left-color` value              | `green`              |
| `borderX`                 | PropTypes.string                     | Set CSS `border-left` and `border-right` value | `2px dotted red`     |
| `borderY`                 | PropTypes.string                     | Set CSS `border-top` and `border-bottom` value | `1px solid black`    |

---

### React Slide Layouts (`docs/react-slide-layouts.md`)

---
title: React Slide Layouts
order: 6
sidebar_position: 6
---

import Full from '../website/static/img/slide-layouts/full.png';

## SlideLayout

`SlideLayout` is a set of helper components used to create slides from a set of pre-defined layouts, so you can avoid dealing with things like layout primitives.

### `SlideLayout.Full`

A full-slide layout

| Props           | Type                                 | Example |
|-----------------|--------------------------------------|---------|
| `...slideProps` | [Slide Props](./api-reference#slide) |         |



### `SlideLayout.Center`

A layout with centered content

| Props           | Type                                 | Example |
|-----------------|--------------------------------------|---------|
| `...slideProps` | [Slide Props](./api-reference#slide) |         |



### `SlideLayout.TwoColumn`

A layout with two columns

| Props           | Type                                 | Example                    |
|-----------------|--------------------------------------|----------------------------|
| `...slideProps` | [Slide Props](./api-reference#slide) |                            |
| `left`          | `ReactNode`                          | `<Heading>Left</Heading>`  |
| `right`         | `ReactNode`                          | `<Heading>Right</Heading>` |

 

### `SlideLayout.List`

A layout with a list and an optional title

| Props              | Type                                             | Required | Example                         |
|--------------------|--------------------------------------------------|----------|---------------------------------|
| `...slideProps`    | [Slide Props](./api-reference#slide)             | ❌        |                                 |
| `items`            | `ReactNode[]`                                    | ✅        | `['Hello', <Text>World</Text>]` |
| `title`            | `string`                                         | ❌        | `My list slide`                 |
| `titleProps`       | [Heading Props](./api-reference#typography-tags) | ❌        | `{ color: 'red' }`              |
| `animateListItems` | `boolean`                                        | ❌        | `true`                          |
| `listProps`        | [List Props](./api-reference#typography-tags)    | ❌        | `{ backgroundColor: 'purple' }` |



### `SlideLayout.Section`

A layout with a section title

| Props           | Type                                          | Required | Example              |
|-----------------|-----------------------------------------------|----------|----------------------|
| `...slideProps` | [Slide Props](./api-reference#slide)          | ❌        |                      |
| `sectionProps`  | [Text Props](./api-reference#typography-tags) | ❌        | `{ fontSize: "48px" }` |



### `SlideLayout.Statement`

A layout with a centered statement

| Props            | Type                                          | Required | Example              |
|------------------|-----------------------------------------------|----------|----------------------|
| `...slideProps`  | [Slide Props](./api-reference#slide)          | ❌        |                      |
| `statementProps` | [Text Props](./api-reference#typography-tags) | ❌        | `{ fontSize: "48px" }` |



### `SlideLayout.BigFact`

A layout to present a fact in large font

| Props                  | Type                                          | Required | Example               | Default |
|------------------------|-----------------------------------------------|----------|-----------------------|---------|
| `children`             | `ReactNode`                                   | ✅        | `100%`                |         |
| `...slideProps`        | [Slide Props](./api-reference#slide)          | ❌        |                       |         |
| `factInformation`      | `ReactNode`                                   | ❌        | `Fact information`    |         |
| `factProps`            | [Text Props](./api-reference#typography-tags) | ❌        | `{ fontSize: "100px" }` |         |
| `factInformationProps` | [Text Props](./api-reference#typography-tags) | ❌        | `{ fontSize: "48px" }`  |         |
| `factFontSize`         | `string`                                      | ❌        | `150px`               | `250px` |



### `SlideLayout.Quote`

A quote and attribution layout

| Props              | Type                                          | Required | Example               |
|--------------------|-----------------------------------------------|----------|-----------------------|
| `...slideProps`    | [Slide Props](./api-reference#slide)          | ❌        |                       |
| `children`         | `ReactNode`                                   | ✅        | `To be, or not to be` |
| `attribution`      | `ReactNode`                                   | ✅        | `William Shakespeare` |
| `quoteProps`       | [Text Props](./api-reference#typography-tags) | ❌        | `{ fontSize: "100px" }` |
| `attributionProps` | [Text Props](./api-reference#typography-tags) | ❌        | `{ fontSize: "48px" }`  |




### `SlideLayout.Code`

A layout with a single code pane and an optional title

| Props           | Type                                             | Required | Example                                                          |
|-----------------|--------------------------------------------------|----------|------------------------------------------------------------------|
| `...slideProps` | [Slide Props](./api-reference#slide)             | ❌        |                                                                  |
| `children`      | `string`                                         | ✅        | `const Component = (props: componentProps): JSX.Element = {...}` |
| `language`      | `boolean`                                        | ✅        | `false`                                                          |
| `title`         | `string`                                         | ❌        | `Show me the code!`                                              |
| `titleProps`    | [Heading Props](./api-reference#typography-tags) | ❌        | `{ color: 'red' }`                                               |
| `codePaneProps` | `CodePaneProps`                                  | ❌        |                                                                  |



### `SlideLayout.MultiCodeLayout`

A layout with more than one code block: multiple code panes with optional descriptions, and an optional slide title.

| Props           | Type                                             | Required | Example                                                                                                             |
|-----------------|--------------------------------------------------|----------|---------------------------------------------------------------------------------------------------------------------|
| `...slideProps` | [Slide Props](./api-reference#slide)             | ❌        |                                                                                                                     |
| `codeBlocks`    | `CodeBlock[]`                                    | ✅        | `[{ code: 'console.log("hello world!")', language: 'jsx', description: 'Say hello', codePaneProps: {...} }, {...}]` |
| `title`         | `string`                                         | ❌        | `Show me the code!`                                                                                                 |
| `titleProps`    | [Heading Props](./api-reference#typography-tags) | ❌        | `{ color: 'red' }`                                                                                                  |
| `numColumns`    | `number`                                         | ❌        | `{2}`                                                                                                               |

where

```ts
type CodeBlock = Omit<CodePaneProps, 'children'> & {
  code: CodePaneProps['children'];
  description?: string | ReactNode;
  descriptionProps?: ComponentProps<typeof Text>;
}
```



### `SlideLayout.HorizontalImage`

A layout with one image per slide: a horizontal/landscape image and an optional title or description.

| Props               | Type                                          | Required | Example                                                                   |
|---------------------|-----------------------------------------------|----------|---------------------------------------------------------------------------|
| `...slideProps`     | [Slide Props](./api-reference#slide)          | ❌        |                                                                           |
| `src`               | `string`                                      | ✅        | `https://raw.githubusercontent.com/FormidableLabs/dogs/main/src/fred.jpg` |
| `alt`               | `string`                                      | ✅        | `Fred the dog looking at the camera`                                      |
| `imgProps`          | `ImgHTMLAttributes<HTMLImageElement>`         | ❌        | `{ style: { objectFit: 'contain' } }`                                     |
| `imgContainerProps` | `ComponentProps<typeof FlexBox>`              | ❌        | `{ style: { border: '8px solid white' } }`                                |
| `title`             | `string \| ReactNode`                         | ❌        | `Fred is a 100% pure bred good boy!`                                      |
| `titleProps`        | [Text Props](./api-reference#typography-tags) | ❌        | `{ color: 'red' }`                                                        |
| `description`       | `string \| ReactNode`                         | ❌        | `and we love him`                                                         |
| `descriptionProps`  | [Text Props](./api-reference#typography-tags) | ❌        | `{ color: 'white' }`                                                      |
| `objectFit`         | `React.CSSProperties['objectFit']`            | ❌        | `cover`                                                                   |





### `SlideLayout.VerticalImage`

A layout with one image per slide: a vertical/portrait image with a bulleted list and an optional title.

| Props               | Type                                                        | Required | Example                                                                   |
|---------------------|-------------------------------------------------------------|----------|---------------------------------------------------------------------------|
| `...slideProps`     | [Slide Props](./api-reference#slide)                        | ❌        |                                                                           |
| `src`               | `string`                                                    | ✅        | `https://raw.githubusercontent.com/FormidableLabs/dogs/main/src/fred.jpg` |
| `alt`               | `string`                                                    | ✅        | `Fred the dog looking at the camera`                                      |
| `imgProps`          | `ImgHTMLAttributes<HTMLImageElement>`                       | ❌        | `{ style: { objectFit: 'contain' } }`                                     |
| `imgContainerProps` | `ComponentProps<typeof FlexBox>`                            | ❌        | `{ style: { border: '8px solid white' } }`                                |
| `position`          | `right` \| `left`                                           | ❌        | `right`                                                                   |
| `title`             | `string \| ReactNode`                                       | ❌        | `Fred is a 100% pure bred good boy!`                                      |
| `titleProps`        | [Text Props](./api-reference#typography-tags)               | ❌        | `{ color: 'red' }`                                                        |
| `listItems`         | `ReactNode[]`                                               | ❌        | `['brown hair', 'brown eyes', 'happy boy']`                               |
| `animateListItems`  | `boolean`                                                   | ❌        | `true`                                                                    |
| `listType`          | `ordered` \| `unordered`                                    | ❌        | `unordered`                                                               |
| `listProps`         | `ComponentProps<typeof UnorderedList & typeof OrderedList>` | ❌        | `{ color: 'white' }`                                                      |
| `objectFit`         | `React.CSSProperties['objectFit']`                          | ❌        | `cover`                                                                   |




### `SlideLayout.ThreeUpImage`

A layout with three images per slide: a primary, a top and bottom images.

| Props           | Type                                            | Required | Example                                                                                                                        |
|-----------------|-------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------|
| `...slideProps` | [Slide Props](./api-reference#slide)            | ❌        |                                                                                                                                |
| `primary`       | `ImagePane & { position?: 'right' \| 'left'; }` | ✅        | `{src: 'https://raw.githubusercontent.com/FormidableLabs/dogs/main/src/fred.jpg', alt: 'Fred the dog looking at the camera' }` |
| `top`           | `ImagePane`                                     | ✅        | `{src: 'https://raw.githubusercontent.com/FormidableLabs/dogs/main/src/fred.jpg', alt: 'Fred the dog looking at the camera' }` |
| `bottom`        | `ImagePane`                                     | ✅        | `{src: 'https://raw.githubusercontent.com/FormidableLabs/dogs/main/src/fred.jpg', alt: 'Fred the dog looking at the camera' }` |

where

```ts
type ImagePane = {
  src: string;
  alt: string;
  imgProps?: React.ImgHTMLAttributes<HTMLImageElement>;
  imgContainerProps?: ComponentProps<typeof FlexBox>;
  objectFit?: React.CSSProperties['objectFit'];
}
```



### `SlideLayout.FullBleedImage`

A layout with an image that covers the entire slide.

| Props               | Type                                  | Required | Example                                                                   |
|---------------------|---------------------------------------|----------|---------------------------------------------------------------------------|
| `...slideProps`     | [Slide Props](./api-reference#slide)  | ❌        |                                                                           |
| `src`               | `string`                              | ✅        | `https://raw.githubusercontent.com/FormidableLabs/dogs/main/src/fred.jpg` |
| `alt`               | `string`                              | ✅        | `Fred the dog looking at the camera`                                      |
| `imgProps`          | `ImgHTMLAttributes<HTMLImageElement>` | ❌        | `{ style: { objectFit: 'contain' } }`                                     |
| `imgContainerProps` | `ComponentProps<typeof FlexBox>`      | ❌        | `{ style: { border: '8px solid white' } }`                                |
| `objectFit`         | `React.CSSProperties['objectFit']`    | ❌        | `cover`                                                                   |

---

### Themes (`docs/themes.md`)

---
title: Themes
order: 8
sidebar_position: 8
---

# Theme System

Spectacle has a robust theme system that is built upon styled system.

A theme is a 2-level deep object of labeled theme keys and CSS property object values, which is passed directly to the `Deck` component.

## Theme Object

The following is an example of a simple custom theme object:

```js
const theme = {
  colors: {
    primary: '#f00',
    secondary: '#00f'
  },
  fontSizes: {
    header: '64px',
    paragraph: '28px'
  }
};
```

## Usage

Components in Spectacle can accept either a value label such as `primary` or a raw CSS value like `#f00`.
The label `primary` returns `#f00` since the `backgroundColor` prop (CSS property `background-color`) is mapped to the `colors` theme key.

```jsx
<Box backgroundColor="primary" />
<Box backgroundColor="#f00" />
```

## Theme Keys

Common CSS properties are divided into theme keys, which you can override in your custom theme object:

| Theme Key        | CSS Properties                                                          |
| ---------------- | ----------------------------------------------------------------------- |
| `space`          | `margin`, `padding`, `grid-gap`                                         |
| `colors`         | `color`, `background-color`, `border-color`                             |
| `sizes`          | `width`, `height`, `min-width`, `max-width`, `min-height`, `max-height` |
| `fontSizes`      | `font-size`                                                             |
| `borders`        | `border`, `border-top`, `border-right`, `border-bottom`, `border-left`  |
| `borderWidths`   | `border-width`                                                          |
| `borderStyles`   | `border-style`                                                          |
| `radii`          | `border-radius`                                                         |
| `fonts`          | `font-family`                                                           |
| `fontWeights`    | `font-weight`                                                           |
| `lineHeights`    | `line-height`                                                           |
| `letterSpacings` | `letter-spacing`                                                        |
| `shadows`        | `box-shadow`, `text-shadow`                                             |
| `zIndices`       | `z-index`                                                               |

Additionally, there are keys for assorted overrides for the presentation:

| Theme Key        | Type                  | Description                                                          |
| ---------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `backdropStyle`  | `React.CSSProperties` | Set styles for the backdrop (the edge-to-edge area behind the slides) similar to React `style` props, e.g., `{ backgroundColor: '#FFF' }`. Defaults to `{ position: 'fixed', top: 0, left: 0, width: '100vw', height: '100vh' }` |
| `Backdrop`       | `React.ElementType`   | Replace the default backdrop component (which appears behind the slides) with a completely custom component or tag name, e.g., `'main'` or `MyCustomComponent`. Defaults to `'div'`.                                             |

## Deck Templates

A template in Spectacle is a fixed overlay of components that are presented on every slide. They are similar to masters in Keynote or PowerPoint. It’s a function prop that has a single optional config object containing the current slide and total slide count and returns a React Node.

```jsx
<Deck template={({ slideNumber, numberOfSlides }) => (
  <FlexBox
    justifyContent="space-between"
    position="absolute"
    bottom={0}
    width={1}
  >
    <Box padding="0 1em">
      <FullScreen />
    </Box>
    <Box padding="1em">
      <Progress />
      Slide {slideNumber} of {numberOfSlides}
    </Box>
  </FlexBox>
)}>
```

## Scaled Spacing

The `space` key is used as a scale for margins, paddings, and gaps for grids. It is an array of integer values. This allows for a more consistent scale of sizes throughout your presentation. The default theme uses three values on the scale, `16`, `24`, and `32`.

Given the following theme:

```jsx
let theme = {
  space: [16, 24, 32]
};
```

One can use a scale value by passing the index of the value as a numeric prop to any space theme property (such as `padding` or `margin`), like so:

```jsx
<Text padding={2}>Hello World</Text>
```

### Default Margin Assignments

Spectacle components use different values on the space scale as defaults for margins. The values can be overridden in your theme by providing alternative values as part of a space array that is at least 3 values deep. If no value is provided, Spectacle will default to `0`. Individual margin values can be also provided as `margin` props to the component.

| Component       | Default Space Index | Default Theme Value |
| --------------- | ------------------- | ------------------- |
| `Slide`         | `2`                 | `32px`              |
| `Heading`       | `1`                 | `24px`              |
| `Text`          | `0`                 | `16px`              |
| `OrderedList`   | `0`                 | `16px`              |
| `UnorderedList` | `0`                 | `16px`              |
| `ListItem`      | `0`                 | `16px`              |
| `Link`          | `0`                 | `16px`              |
| `Quote`         | `0`                 | `16px`              |
| `CodeSpan`      | `0`                 | `16px`              |

---

--- METRICS ---
- Files Extracted: 10
- Estimated Token Budget: ~21290 tokens
- Canonical Reference: https://codewiki.google/github.com/FormidableLabs/spectacle
