Spectacle: React Presentation Framework

10.2.3 ยท active ยท verified Sun Apr 19

Spectacle is an actively maintained, ReactJS-powered library for creating interactive and dynamic presentations. As of version 10.2.3, it provides a comprehensive suite of React components (e.g., `Deck`, `Slide`, `FlexBox`, `Heading`) that enable developers to build highly customizable slideshows using standard web technologies. The library typically receives regular patch and minor updates, addressing bug fixes and introducing new features like the recent `FitText` component in v10.2.0. Spectacle differentiates itself by allowing the full power of React and its ecosystem to be leveraged for presentation design, offering a developer-centric alternative to traditional presentation software and enabling complex animations, data visualizations, and interactive elements directly within slides.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a basic Spectacle presentation using the `Deck`, `Slide`, `Heading`, `Text`, `Box`, and `FlexBox` components, along with a custom theme.

import React from 'react';
import {
  Deck,
  Slide,
  Heading,
  Text,
  Box,
  FlexBox,
  createTheme,
} from 'spectacle';

const theme = createTheme(
  {
    primary: 'white',
    secondary: '#1F2022',
    tertiary: '#03A9F4',
    quaternary: '#CECECE',
  },
  {
    primary: 'Inter',
    secondary: 'Helvetica',
  }
);

function Presentation() {
  return (
    <Deck theme={theme}>
      <Slide backgroundColor="primary">
        <Heading color="secondary">Welcome to Spectacle!</Heading>
        <Text color="tertiary">
          A ReactJS Powered Presentation Framework
        </Text>
      </Slide>
      <Slide backgroundColor="secondary">
        <FlexBox height="100%" flexDirection="column" justifyContent="center" alignItems="center">
          <Heading fontSize="h2" color="primary">Key Features</Heading>
          <Box margin="20px 0">
            <Text color="quaternary">๐Ÿ”ฅ Full React Ecosystem</Text>
            <Text color="quaternary">๐ŸŽจ Highly Customizable Themes</Text>
            <Text color="quaternary">๐Ÿš€ Interactive Slides</Text>
          </Box>
        </FlexBox>
      </Slide>
      <Slide backgroundColor="tertiary">
        <Heading fontSize="h3" color="primary">Get Started</Heading>
        <Text color="secondary">
          Install with `npm install spectacle react react-dom`
        </Text>
        <Text color="secondary">
          Then run your React app!
        </Text>
      </Slide>
    </Deck>
  );
}

export default Presentation;

view raw JSON โ†’