Layout & Constraints
Live Examples
1. Declarative Zone Layout Schema (RedDokiaZoneLayoutSchema)
Declare the central document stage (contents), 6 outer EdgeBar slots (leftTopEdgeBar, leftBottomEdgeBar, rightTopEdgeBar, rightBottomEdgeBar, bottomLeftEdgeBar, bottomRightEdgeBar), topBar, and statusBar with RedDokiaZoneLayoutSchema.
import type { RedDokiaLayoutSchema } from 'reddokia';
export const layoutSchema: RedDokiaLayoutSchema = {
topBar: { logoText: 'RD', title: 'Studio' },
statusBar: true,
leftTopEdgeBar: {
children: ['explorer'],
size: 260,
minSize: 180,
maxSize: 420,
snap: true,
},
contents: ['editor-1', 'editor-2'],
bottomLeftEdgeBar: {
children: ['console'],
size: 160,
minSize: 100,
},
rightTopEdgeBar: {
children: ['inspector'],
size: 280,
collapsed: true,
},
};3-Level Authoring Shorthand
Inside contents and any split node's children, you can mix three shorthand levels depending on your needs:
| Level | Syntax | Example & Purpose |
|---|---|---|
1. View ID Array (string[]) | ['view-a', 'view-b'] | Shortest way to declare a single tab group (first view starts active) |
2. Group Schema (RedDokiaGroupSchema) | { children: ['a', 'b'], activeViewId: 'b', minSize: 200, locked: true } | Configure initial active tab, size bounds, chromeless header (showHeader: false), or locked state |
3. Split Tree (RedDokiaSplitSchema) | { type: 'col', children: [['top'], ['bottom']] } | Nest horizontal ('row', default) or vertical ('col') splits to any depth |
RedDokiaViewSchema DX Conveniences
- Auto-Formatted
title: Omittingtitleinviewsautomatically formatsid('scene-inspector'→'Scene Inspector'). - Flexible
iconValues: Pass built-inRedDokiaIcons.*constants, image/SVG URLs ('/favicon.svg','./logo.png',data:image/...), raw<svg>markup, or framework icon components.
2. Size Constraints (Flat Schema Properties)
Declare size constraints directly as top-level properties on any group (RedDokiaGroupSchema), split (RedDokiaSplitSchema), EdgeBar slot (RedDokiaEdgeBarSchema), or view (RedDokiaViewSchema). The engine compiles them into normalized RedDokiaNodeConstraints at runtime.
| Property | Type | Description |
|---|---|---|
size | number | Relative flex share among siblings (or pixel size for fixed groups and EdgeBar slots) |
minSize / maxSize | number | Min/max pixels along the parent split axis |
minWidth / maxWidth | number | Horizontal-axis min/max pixels |
minHeight / maxHeight | number | Vertical-axis min/max pixels |
fixed | boolean | Locks pixel size, blocks sash dragging, and preserves width across window resizes |
snap | boolean | Auto-collapses the pane when dragged past half of its minimum size |
Sash Double-Click Equalize
Double-clicking any split sash immediately equalizes its two adjacent panes to 50:50.
3. Protected Groups (emptyContents · showHeader · locked)
emptyContents: Keeps thecontentsgroup mounted and displays a custom welcome screen when all tabs close.showHeader: false: Hides the tab bar for chromeless viewports (toggleable at runtime viacontroller.setGroupOptions(groupId, { showHeader })).locked: true: Blocks external tab drops, splits, and tab closing on the group (toggleable at runtime viacontroller.toggleLockGroup(groupId)).