Introduction
Build video editors, not video editor plumbing.
Miraiclip SDK is a framework-agnostic engine for video editors that run in the browser. You bring the UI. It brings the timeline, the commands, the renderer and the export.
Loading demo…
What you get
| Commands, not mutations | Every edit is a validated, serializable, undoable command. |
| Undo, redo, transactions | Exact history out of the box. |
| Frame-accurate preview | WebCodecs + WebGL: the preview shows the same pixels as the export. |
| Export anywhere | MP4 or WebM in the browser, in a worker, or from Node. No render servers. |
| Creative toolkit | Keyframes, 79 effects, transitions, karaoke captions, HTML clips. |
| Templates | One composition becomes many personalized videos, with batch rendering and a CLI. |
| AI-native | LLM tools from the command catalog, an editing assistant, an MCP server. |
| Any framework | Headless core. Use it with React, Vue, Svelte, vanilla JS or Node: see Installation. |
What people build with it
An editor in your product
A timeline, preview and export inside your app, styled your way.
Ad variants
Many versions of one ad, in every aspect ratio, for testing.
Catalog to product video
Product feeds into on-brand video ads.
Personalized video
One video per customer from your data.
Pick your framework
The docs follow the framework picked in the sidebar. Most of the API is the same everywhere. Only the code that binds Miraiclip to your UI changes, and those snippets switch with your choice:
Mount a preview
import { createPreviewController } from "@miraiclip/renderer";
import { project } from "./project";
const canvas = document.querySelector<HTMLCanvasElement>("#preview")!;
const button = document.querySelector<HTMLButtonElement>("#play")!;
const preview = createPreviewController(project);
preview.attach(canvas, { width: canvas.clientWidth, height: canvas.clientHeight });
button.addEventListener("click", () => preview.toggle());
preview.subscribe(() => {
button.textContent = preview.getState().playing ? "Pause" : "Play";
});
// When the view goes away:
// preview.destroy();Also uses project.ts
import { createProject } from "@miraiclip/core";
// One project instance for the whole app. Pass it to components as a prop.
export const project = createProject({ width: 1280, height: 720, fps: 30 });import { Preview, usePlayback } from "@miraiclip/react";
// Inside <ProjectProvider> and <PlaybackProvider>.
export function PreviewPanel() {
const { isPlaying, toggle } = usePlayback();
return (
<>
{/* Hands its canvas to <PlaybackProvider>, keeps it sized, releases it on unmount. */}
<Preview width={640} height={360} />
<button type="button" onClick={toggle}>
{isPlaying ? "Pause" : "Play"}
</button>
</>
);
}<script setup lang="ts">
import { onBeforeUnmount, onMounted, shallowRef, useTemplateRef } from "vue";
import type { Project } from "@miraiclip/core";
import { createPreviewController } from "@miraiclip/renderer";
const props = defineProps<{ project: Project }>();
const canvas = useTemplateRef<HTMLCanvasElement>("canvas");
const preview = createPreviewController(props.project);
const state = shallowRef(preview.getState());
const stop = preview.subscribe(() => (state.value = preview.getState()));
onMounted(() => {
const el = canvas.value!;
preview.attach(el, { width: el.clientWidth, height: el.clientHeight });
});
onBeforeUnmount(() => {
stop();
preview.destroy();
});
</script>
<template>
<canvas ref="canvas" style="width: 640px; height: 360px" />
<button @click="preview.toggle()">{{ state.playing ? "Pause" : "Play" }}</button>
</template><script lang="ts">
import type { Project } from "@miraiclip/core";
import { createPreviewController, type PreviewController } from "@miraiclip/renderer";
let { project }: { project: Project } = $props();
let canvas = $state<HTMLCanvasElement>();
let playing = $state(false);
let preview: PreviewController | undefined;
$effect(() => {
if (!canvas) return;
const controller = createPreviewController(project);
preview = controller;
const stop = controller.subscribe(() => (playing = controller.getState().playing));
controller.attach(canvas, { width: canvas.clientWidth, height: canvas.clientHeight });
return () => {
stop();
controller.destroy();
preview = undefined;
};
});
</script>
<canvas bind:this={canvas} style="width: 640px; height: 360px"></canvas>
<button onclick={() => preview?.toggle()}>{playing ? "Pause" : "Play"}</button>