Overview of Spectacle
mainspectacle package, various example implementations (JS, MD, MDX, TS), and supporting tools like create-spectacle and spectacle-mdx-loader.repository·main·Indexed 26 days ago
https://github.com/formidablelabs/spectacleA ReactJS-based presentation library for creating slide decks using React components and Markdown/MDX. The ecosystem includes the core spectacle package, create-spectacle for project scaffolding, and spectacle-mdx-loader for webpack integration. It provides a comprehensive set of API components including Deck, Slide, and various typography, layout, and table tags, as well as animation tools like the Stepper component, Appear component, and useSteps hook.
spectacle package, various example implementations (JS, MD, MDX, TS), and supporting tools like create-spectacle and spectacle-mdx-loader.SlideLayout is a set of helper components used to create slides from pre-defined layouts, allowing you to avoid manual layout primitive management. It provides various specialized layouts for content like lists, code, images, and quotes.Use create-spectacle to generate a boilerplate for your Spectacle presentation. You can run the generator using your preferred package manager. After running the command, you will be prompted to provide project details, and a new directory will be created based on the project name provided.
yarn create spectacle # yarn
npm create spectacle # npm
npx create-spectacle # using npx
pnpm create spectacle # using pnpmYou can export your presentation to PDF by appending query parameters to your presentation URL. This flattens the presentation, allowing you to use your browser's 'Print to PDF' functionality.
?exportMode=true to the URL to flatten the slides for PDF export.?exportMode=true&printMode=true to the URL to generate a printer-friendly, flattened, black & white version of your slideshow.The fastest way to start a new Spectacle project is using the create-spectacle CLI. This tool sets up a new project with a default deck and all necessary dependencies.
Available templates:
htm. Recommended for quick decks as it requires no server.MarkdownSlideSet component.$ npx create-spectacleTo begin using Spectacle, you can explore the core spectacle package or visit the official documentation site for detailed guides and tutorials.
spectacleInstall spectacle-mdx-loader as a development dependency using npm or yarn to enable MDX support for Spectacle presentation decks via webpack.
$ npm add --save-dev spectacle-mdx-loader
$ yarn add --dev spectacle-mdx-loader.ts or .js presentations without importing separate type definitions. TypeScript is the default language for Spectacle and the create-spectacle CLI, requiring no additional configuration.The space key is an array of integer values used as a scale for margin, padding, and grid-gap. You can access a specific value from the scale by passing its index as a numeric prop to a component.
Example with a custom scale:
let theme = {
space: [16, 24, 32]
};
// Using index 2 (which is 32) for padding
<Text padding={2}>Hello World</Text>let theme = {
space: [16, 24, 32]
};
<Text padding={2}>Hello World</Text>To skip the interactive CLI prompts and create a project immediately, you must provide the project name as the main argument along with the --type (-t), --lang (-l), and --port (-p) flags.
yarn create spectacle -t jsx -l en -p 8080 my-presentation$ yarn