You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support for App Router + SSR, moved to tsup for ESM/CJS (#1263)
* Added support for App Router + SSR, moved to for building
* Fix extension
* Fix UMD build, add DefaultTemplate component.
* dedent template docs
* Switch to CJS import.
* Clean up tasks, remove ULID.
* Added top-level typecheck to scripts.
|**`CodeSpan`**|[**Space**](./props#space)<br />[**Color**](./props#color)<br /> [**Typography**](./props#typography)| — |**fontFamily**: monospace<br />**fontSize**: text |
66
66
67
+
68
+
## Templates 🆕
69
+
70
+
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`.
Copy file name to clipboardExpand all lines: docs/tutorial.md
+48-12Lines changed: 48 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,25 +8,24 @@ sidebar_position: 3
8
8
9
9
In this guide, we'll show you a couple of different ways to get started with Spectacle and walk you through the creation and customization of a presentation deck.
10
10
11
-
## Option One: Using a standard React-based web app
11
+
## Option One: Using Vite to bootstrap a React-based Spectacle app
12
12
13
-
1. Spin up a new React project using [`create-react-app`](https://github.com/facebook/create-react-app):
13
+
1. Spin up a new React project using [`vite`](https://vitejs.dev/guide/#scaffolding-your-first-vite-project):
@@ -37,9 +36,46 @@ In this guide, we'll show you a couple of different ways to get started with Spe
37
36
exportdefaultApp;
38
37
```
39
38
40
-
4. And you're good to go! Using `create-react-app`'s built-in `start` script, you can start a hot-reloading server to begin building your Spectacle presentation by running `yarn run start` or `npm run start`.
39
+
## Option Two: Using NextJS App Router to bootstrap a React-based Spectacle app
41
40
42
-
## Option Two: Using Markdown and the Spectacle CLI
41
+
1. Spin up a new React project using [`vite`](https://vitejs.dev/guide/#scaffolding-your-first-vite-project):
42
+
43
+
```bash
44
+
npx create-next-app@latest
45
+
```
46
+
47
+
2. Install Spectacle by running `npm add spectacle`.
48
+
49
+
3. Create a `deck.tsx` file inside the `app` directory and add the following Spectacle starter:
4. In `App.tsx`, import the `<SpectacleDeck />` component:
68
+
69
+
```tsx
70
+
import { SpectacleDeck } from"./deck";
71
+
72
+
exportdefaultfunction Home() {
73
+
return <SpectacleDeck />;
74
+
}
75
+
76
+
```
77
+
78
+
## Option Three: Using Markdown and the Spectacle CLI
43
79
44
80
1. Create a new markdown file. You can use `.md` or `.mdx` (MDX lets you mix JSX components inside markdown).
45
81
@@ -71,7 +107,7 @@ In this guide, we'll show you a couple of different ways to get started with Spe
71
107
72
108
3. And you're good to go! The web server you started supports live refreshing and will update your deck as you make changes to the markdown file.
73
109
74
-
## Option Three: Using One Page
110
+
## Option Four: Using One Page
75
111
76
112
One Page is a single self-contained `HTML` file that lets you build a deck using no build steps, using [htm](https://github.com/developit/htm) over JSX to reduce the dependencies and load time.
0 commit comments