Skip to main content

Theming example

Now you can start using global theme options to set slide as you like.

import { PresentifyProvider } from 'presentify';

<PresentifyProvider options={{useFiraCode: true, theme: 'dark', backgroundColor: '#636e72'}}>
# Introducing Hooks

### What are they? And why do we need them?

</PresentifyProvider>

But you want to first slide to be different? No problem, you can override global options for each slide. You need to use frontmatter syntax but change --- to +++ to avoid conflict with slide separator.

import { PresentifyProvider } from 'presentify';

<PresentifyProvider options={{useFiraCode: true, theme: 'dark', backgroundColor: '#636e72'}}>
+++
backgroundImg: 'https://picsum.photos/536/354'
+++
# Introducing Hooks

### What are they? And why do we need them?

---

# UseState

### `useState` is React Hook that allows you to add state to a functional component.

</PresentifyProvider>

Now your first slide has different background and the rest of the slides are using global options.

Global Options

OptionTypeOptionalDefaultDescription
themedark / light✔️lightcode syntax highlighter theme (dark = vsDark, light = github)
useFiraCodeboolean✔️falseuse firaCode font with ligatures in Code syntax highlighter
classNamestring✔️noneset className to slide parent div
backgroundColorstring✔️whiteset background color to slide
backgroundImgstring✔️noneset background Image to slide
layoutnormal / center✔️centerset layout of slide

Slide Options

OptionTypeOptionalDefaultDescription
classNamestring✔️noneset className to slide parent div
backgroundColorstring✔️whiteset background color to slide
backgroundImgstring✔️noneset background Image to slide
layoutnormal / center✔️centerset layout of slide