reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
Start
Overview
Install and embed
Document model and editing
AI generation and proposals
Persistence, assets and sharing
Presentation and export
API and troubleshooting
Deck Studio
Oopt-deck
reopt designreopt design

A design system for the AI era

  • Docs
  • Pricing
  • Releases
  • About
  • Contact
  • Terms of Service
  • Privacy Policy

reopt Inc.Business registration no. 217-88-02453contact@reopt.ai

© 2026 reopt Inc. All rights reserved.

Start
  1. Docs
  2. /
  3. Start
  4. /
  5. opt-deck 설치와 첫 임베드

Install and embed

Install the package, host runtime assets and connect a controlled editor or standalone viewer.

reopt design · Updated Nov 1, 2026

opt-deckInstall and embedDocument model and editingAI generation and proposalsPersistence, assets and sharingPresentation and exportAPI reference and troubleshooting
Try the editorBrowse design collections

Package and host responsibilities

opt-deck owns document validation, editing, presentation and export. The consuming app supplies authentication, persistence, asset authorization, model transport and usage policies. The /api/presentation-* URLs in these guides are host examples that you implement.

1. Install and prepare static assets

Use Node.js 20+ and React/React DOM 19.2.3+ within the supported major version. Next.js and a backend are not required. After installation, copy CanvasKit and bundled fonts into the app public directory.

Run the asset-copy command during builds after installing or upgrading the package. The default URL is /deck-assets; canvaskit.js, canvaskit.wasm and font files must all be accessible.

Terminal
bun add @reopt-ai/opt-deck
bunx opt-deck-assets public/deck-assets

2. Your first editor

Create a document in a React client component and connect value/onChange. In Next.js, mark the component with use client and import styles.css once from an appropriate application entry. This example edits in memory without server persistence. Editor controls use opt-ui-primitives with package-owned styles; Tailwind and an opt-ui stylesheet are not required.

presentation.tsx
"use client";
import { useState } from "react";
import { DeckEditor, createDeckDocument } from "@reopt-ai/opt-deck";
import "@reopt-ai/opt-deck/styles.css";

export function Presentation() {
  const [document, setDocument] = useState(() =>
    createDeckDocument({ design: "editorial", title: "Acme" }),
  );
  return (
    <DeckEditor
      value={document}
      onChange={setDocument}
      locale="ko"
      style={{ height: "min(850px, 100dvh)" }}
    />
  );
}

3. Controlled and uncontrolled state

With value/onChange the host retains the current document. Store the exact object emitted by the editor. Cloning value on every render can be interpreted as an external replacement and clear history.

defaultValue initializes the document once. To open another document, use controlled value or remount with a document-ID key. value expects v2; migrate v1 with migrateDeckDocument. defaultValue also accepts legacy input.

4. Embed a viewer

Use the /viewer entry for read-only pages. It accepts the same v2 document. Hide navigation with controls=false, or pair slideId with onSlideChange for host-controlled navigation.

presentation-viewer.tsx
"use client";
import { DeckViewer } from "@reopt-ai/opt-deck/viewer";
import type { DeckDocument } from "@reopt-ai/opt-deck/server";
import "@reopt-ai/opt-deck/styles.css";

export function PresentationViewer({ document }: { document: DeckDocument }) {
  return (
    <DeckViewer
      document={document}
      locale="ko"
      controls
      showNotes={false}
      autoPlay={false}
      style={{ height: 720 }}
    />
  );
}

5. Configure runtime assets

Set assetBaseUrl when assets live at a different URL. runtime.fetch handles document assets and font requests. CanvasKit JavaScript is loaded through a script element, so this fetch does not intercept every engine request.

For a CDN, verify script, WASM and font responses, MIME types, CORS and application CSP. Supply a preloaded engine with runtime.canvasKit. Never put secret credentials in client runtime options.

custom-runtime-editor.tsx
"use client";
import { DeckEditor } from "@reopt-ai/opt-deck";
import type { DeckRuntimeOptions } from "@reopt-ai/opt-deck";

const runtime: DeckRuntimeOptions = {
  assetBaseUrl: "/presentation-assets",
  fetch: (input, init) => fetch(input, { ...init, credentials: "same-origin" }),
};

export function CustomRuntimeEditor() {
  return <DeckEditor runtime={runtime} locale="ko" />;
}

6. Verify the first run

Once the first slide appears, double-click text, edit, undo and open presentation mode. Export and reimport JSON or a portable file to check content and assets. AI and server persistence are optional at this stage.

If canvas preparation does not finish, inspect the Network responses for canvaskit.js, canvaskit.wasm and font files. For a 404, match the opt-deck-assets destination to runtime.assetBaseUrl. Missing styles usually mean a missing styles.css import; a blank area can mean a missing container height. Investigate document parsing errors through migrateDeckDocument or parseDeckDocument.

PreviousOverview임베드 가능한 슬라이드 에디터·뷰어와 json-render AI 편집 계약Start
Go to Overview
NextDocument model and editingv2 문서, 트랜잭션, undo/redo, 브랜드와 고객별 파생 자료Start