Registry / productivity / deckjsx

deckjsx

JSON →
library0.7.0jsnpmunverified

deckjsx is a TypeScript library (v0.7.0, active development) for generating PowerPoint (.pptx) presentations from TSX/JSX through a compiler pipeline. Unlike thin wrappers around PptxGenJS, deckjsx is designed as a compiler with explicit phases: author tree, semantic author graph, output projection, and output writer. It features a class-based API with typed JSX elements, CSS-like styling, grid layout support, and a modular architecture. The library ships TypeScript types and currently targets PPTX output via a temporary pptxgenjs writer adapter. Release cadence is irregular as it is early-stage.

npm install deckjsx
INSTALL
IMPORT
SIG · DECKJSX
D
deckjsx
productivityjavascriptv0.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Deck
import { Deck } from 'deckjsx'
import Deck from 'deckjsx'
Named export, not default. Also exported as default in some versions; check your version.
View
import { View } from 'deckjsx'
const View = require('deckjsx').View
View is a layout component, not required for common usage. Import as needed.
JSX types (e.g. JSX.IntrinsicElements)
import type { JSX } from 'deckjsx'
import { JSX } from 'deckjsx'
JSX is a type namespace, import as type only. Valid for TypeScript users.

Creates a new deck, adds a slide with typed JSX content, and renders to a .pptx file.

import { Deck } from 'deckjsx'; const deck = new Deck({ layout: { width: 13.333, height: 7.5, unit: 'in' }, meta: { title: 'My Presentation', author: 'deckjsx' }, }); deck.slide( { name: 'Slide 1', style: { backgroundColor: '#FFFFFF' } }, ({ composition }) => ( <main style={{ x: 0.5, y: 0.5, width: 12, height: 6 }}> <h1 style={{ fontSize: 32, fontWeight: 700 }}>Hello, deckjsx!</h1> <p style={{ fontSize: 18, color: '#333333' }}> This slide was authored with typed JSX. </p> </main> ), ); await deck.render({ output: 'hello-deckjsx.pptx' }); console.log('Presentation generated!');
Debug
Known issues
breakingAPI is unstable and may change significantly before v1.0.0.
fix
Pin to a specific version and refer to changelog before upgrading.
affects: <1.0.0
deprecatedThe pptxgenjs writer adapter is temporary and will be replaced.
fix
Plan to migrate to future native writer when available. Check documentation.
affects: >=0.1.0 <0.7.0
gotchaJSX pragma must be configured if not using a bundler that auto-detects. You may need to add `/** @jsxRuntime automatic */` at the top of files.
fix
Ensure your build tool (e.g., TypeScript, Babel, or SWC) is set to use `jsxImportSource: 'deckjsx'` (or `'deckjsx/jsx-runtime'` in some versions).
affects: >=0.1.0
gotchaChildren of View components are positioned relative to the parent, not the slide. x/y values that seem correct for slide may appear misaligned.
fix
Use slide-level coordinates for direct children of slide. For nested Views, compute positions relative to parent's top-left.
affects: >=0.1.0
breakingImport path for JSX runtime may change between versions (from 'deckjsx/jsx-runtime' to 'deckjsx').
fix
Check documentation for the specific version and configure jsxImportSource accordingly. In v0.7.0, use 'deckjsx'.
affects: >=0.1.0 <0.8.0
Errors
Common errors & fixes
Module not found: Can't resolve 'deckjsx/jsx-runtime'
Incorrect jsxImportSource configuration or outdated version.
fix
Set jsxImportSource in tsconfig.json to 'deckjsx' (not 'deckjsx/jsx-runtime'). For CRA/Next.js, adjust Babel config.
TypeError: deck.slide is not a function
Using a version prior to v0.5.0 where slide method was not yet introduced, or wrong import (e.g., default import).
fix
Ensure you're using deckjsx >=0.5.0 and import `{ Deck }` as a named export.
Cannot find name 'Deck'
Missing import or TypeScript not resolving types.
fix
Add `import { Deck } from 'deckjsx'`. If types are missing, check node_modules/@types or install missing type declarations.
Property 'render' does not exist on type 'Deck'
Using TypeScript without the correct version; render may have been called `writePPTX` in earlier versions.
fix
Upgrade to >=0.7.0 where `render` is the correct method. For older versions, use `deck.render({ output })` or `deck.writePPTX({ output })`.
Upgrade
Version history
0.7.0latest on npm
Audit
Dependencies
pptxgenjsrequiredtemporary pptxgenjs writer adapter for PPTX output (will change as output writers are added)
reactoptionalruntime dependency for JSX runtime (used internally for JSX transpilation)
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
deckjsx — npm install deckjsx · libregistry