Framework Integration Guides
RedDokia shares the exact same layoutSchema and viewsSchema across four first-class official entrypoints tailored to each framework's native lifecycle.
| Framework | Entrypoint | View Hosting | Controller Access |
|---|---|---|---|
| React 18 / 19 | reddokia/react | createPortal (Zero-Unmount) | useRef<RedDokiaController> or onReady |
| Vue 3 | reddokia/vue | <Teleport> + Volar DefineComponent | ref<RedDokiaVueExpose> or @ready |
| Svelte 5 | reddokia/svelte | Native mount/unmount + SvelteMap | onReady callback or use:redDokia |
| Vanilla TS / JS | reddokia | Pure DOM mount function | new RedDokia(...) instance directly |
React 18 / 19
- Entrypoint:
reddokia/react - Hosting: Zero-Unmount React
createPortalinto persistent core host nodes
tsx
import { useRef } from 'react';
import { RedDokia, type RedDokiaController } from 'reddokia/react';
import { layoutSchema } from './layoutSchema';
import { viewsSchema } from './viewsSchema';
export function App() {
const dockRef = useRef<RedDokiaController>(null);
return (
<div style={{ width: '100vw', height: '100vh' }}>
<RedDokia ref={dockRef} views={viewsSchema} layout={layoutSchema} />
</div>
);
}Production Notes
- Next.js / Remix SSR:
<RedDokia />renders a hydration-safe emptyreddokia-react-hostcontainer during SSR with zero Hydration Mismatch warnings. Add'use client'in Next.js App Router. - StrictMode: Safe under React 18/19 double-invocation effects with deterministic engine teardown and remount.
Vue 3
- Entrypoint:
reddokia/vue - Hosting: Zero-Unmount Vue 3
<Teleport> - IDE Support: Full Volar prop, emit, and
refexpose inference viaDefineComponent<RedDokiaProps, RedDokiaVueExpose, ..., RedDokiaVueEmits>
vue
<script setup lang="ts">
import { ref } from 'vue';
import { RedDokia, type RedDokiaVueExpose } from 'reddokia/vue';
import { layoutSchema } from './layoutSchema';
import { viewsSchema } from './viewsSchema';
const dockRef = ref<RedDokiaVueExpose | null>(null);
</script>
<template>
<div style="width: 100vw; height: 100vh">
<RedDokia
ref="dockRef"
:views="viewsSchema"
:layout="layoutSchema"
@ready="(ctrl) => console.log('ready', ctrl)"
/>
</div>
</template>Production Notes
- Register standard
.vueSFC components directly inviewsSchema. - Both Vue events (
@ready,@layout-change,@view-resize) and callback props are supported.
Svelte 5
- Entrypoint:
reddokia/svelte - Hosting: Native Svelte 5
mount/unmount/onDestroy+svelte/reactivitySvelteMapreactive props bridge
svelte
<script lang="ts">
import { RedDokia } from 'reddokia/svelte';
import { layoutSchema } from './layoutSchema';
import { viewsSchema } from './viewsSchema';
</script>
<div style="width: 100vw; height: 100vh">
<RedDokia views={viewsSchema} layout={layoutSchema} />
</div>Or bind declaratively using the use:redDokia Svelte Action:
svelte
<div style="width: 100vw; height: 100vh" use:redDokia={{ views: viewsSchema, layout: layoutSchema }} />Production Notes
- Passing
.sveltecomponents directly inviewsSchemamounts them via Svelte 5mount()with fine-grained reactive prop updates (width,height,active,visible,params) powered bySvelteMap. <RedDokia />automatically registersonDestroy()cleanup so conditional{#if}unmounts never leak listeners or observers.
Vanilla TypeScript
- Entrypoint:
reddokia(Zero-Dependency Pure ESM) - Hosting:
(container, props) => ({ update?, unmount? })mount handlers
ts
import { RedDokia } from 'reddokia';
import { layoutSchema } from './layoutSchema';
import { viewsSchema } from './viewsSchema';
const dock = new RedDokia(document.getElementById('app')!, {
views: viewsSchema,
layout: layoutSchema,
});
// Tear down when done:
// dock.destroy();Production Notes
- The
dockinstance directly exposes allRedDokiaControllermethods at the top level (dock.openView(...),dock.setTheme(...), etc.). - Return
{ update(nextProps), unmount() }from a view mount handler to handle live resize/visibility updates and clean teardown.