Loading...
Loading...
bklit-ui monorepo contributors only. Use automatically when building a new chart, editing an existing chart, prototyping chart props or animation, or working on apps/web/app/playground/. Scaffolds the editor playground with left motion pane, right controls pane, and center chart frame.
npx skill4agent add bklit/bklit-ui bklit-playground/playgroundpackages/uiAGENTS.mdpage.tsxapps/web/app/playground/README.md.agents/skills/bklit-playground/SKILL.md.agents/skills/bklit-playground/templates/page.tsxapps/web/components/editor/apps/web/components/playground/apps/web/app/playground/page.tsx| Region | Purpose |
|---|---|
| Left pane | Animation / motion controls only |
| Center | Dot-grid canvas, rulers, resizable chart frame, bottom menu bar |
| Right pane | Chart props, data, styling, and settings controls |
PlaygroundEmptyStateUse the playground skill to start building a new chart, or ask it to edit an existing chart. Your agent will automatically add the necessary controls.
.agents/skills/bklit-playground/templates/page.tsx
→ apps/web/app/playground/page.tsxhttp://localhost:3000/playgroundpnpm devcontrolGroupsEditorShellStudioUrlStateapps/web/lib/studio/registry-control-groups.tslineChartControlGroupsbarChartControlGroupsgaugeControlGroupsregistry-control-groups.tsapps/web/lib/studio/sidebar-control-templates.tscontrolGroupdataGrouplineGroupdesignGroupusePlaygroundState({ chart: "your-chart", … })import { lineChartControlGroups } from "@/lib/studio/registry-control-groups";
<EditorShell
controlGroups={lineChartControlGroups}
showMotionControls={false} // see left pane rules
chartState={chartState}
…
/>keyStudioUrlStateshowMotionControls={true}MotionControl<EditorShell
showMotionControls
controlGroups={lineChartControlGroups}
chartState={chartState}
…
/>apps/web/lib/studio/motion-config.tsreplayKeyuseReplayKey()apps/web/app/playground/page.tsxEditorShellEditorChartFrameusePlaygroundStateuseReplayKeycontrolGroups={[]}showMotionControls={false}PlaygroundEmptyStatePlaygroundEmptyStatecontrolGroupsshowMotionControls={true}chartState.displayStatechartState.statereplayKeyonReplayuseReplayKey()apps/web/components/playground/| Export | Path | Purpose |
|---|---|---|
| | Full editor layout |
| | Resizable chart container |
| | Default empty chart message |
| | Local studio-like state |
| | |
| | Reference line chart wiring |
| | Example right-pane groups |
PlaygroundShellPlaygroundToolbarResizablePreview"use client";
import { useState } from "react";
import { EditorChartFrame } from "@/components/editor/editor-chart-frame";
import { EditorShell } from "@/components/editor/editor-shell";
import type { ViewportPreset } from "@/components/editor/viewport-presets";
import { resolveViewportSize } from "@/components/editor/viewport-presets";
import { PlaygroundLineChart } from "@/components/playground/playground-line-chart";
import { usePlaygroundLineChartState } from "@/components/playground/use-playground-line-chart-state";
import { useReplayKey } from "@/components/playground/use-replay-key";
import { lineChartControlGroups } from "@/lib/studio/registry-control-groups";
export default function PlaygroundPage() {
const chartState = usePlaygroundLineChartState();
const [replayKey, replay] = useReplayKey();
const [viewport, setViewport] = useState<ViewportPreset | null>("desktop");
const [size, setSize] = useState(() =>
resolveViewportSize("desktop", 960)
);
return (
<EditorShell
chartState={chartState}
controlGroups={lineChartControlGroups}
onReplay={replay}
onSizeChange={(width, height) => setSize({ width, height })}
onViewportChange={setViewport}
showMotionControls
size={size}
viewport={viewport}
>
{({ size: frameSize, boundsRef, onResize, mobileViewport }) => (
<EditorChartFrame
boundsRef={boundsRef}
height={frameSize.height}
onResize={onResize}
resizable={!mobileViewport}
width={frameSize.width}
>
<PlaygroundLineChart
committedState={chartState.state}
motionCurveDragging={chartState.motionCurveDragging}
replayKey={replayKey}
state={chartState.displayState}
/>
</EditorChartFrame>
)}
</EditorShell>
);
}strokeWidthshowMarkersStudioUrlStatedefaultStudioStateapps/web/lib/studio/studio-parsers.tsregistry-control-groups.tschartState.displayStateshowMotionControlsshowMotionControls={true}EditorShellgetStudioCssRevealPropsstudioMotionToTransitionmotionSignature.agents/skills/bklit-ship/SKILL.mdpackages/ui| Item | Path |
|---|---|
| Playground route (gitignored) | |
| Template | |
| Editor components | |
| Playground helpers | |
| Control group registry | |
| Control templates | |
| Ship checklist | |
| Gitignore entry | |