Theme
Sound
Jump to a component
AniCanonKit · Productions
CanvasStage
CanvasStage is the editor's canvas while an item on it is selected: the frame, the item at its size and place, and a box with eight handles to move and resize it.
Live, from @anicanon/sakuga 2.0.0
Sakuga for iOS and Android is coming
iOS
Web only
CanvasStage is made for the web, and isn’t part of Sakuga for iOS yet.
Android
Web only
CanvasStage is made for the web, and isn’t part of Sakuga for Android yet.
Guidelines
boxis the item's place and size in percent of the frame; past the frame's edges it shows dimmed.imageandimageStyledraw the item;ratiois the frame's (default16 / 9);heightthe stage's.onBox(box)makes the box movable: it is called with each new box.
- With
onBox, the box can be dragged to move it, and each handle resizes it from its own edge or corner (never below 1%);onBoxgets each new box as it moves, and the new position is said when the drag ends.
import { CanvasStage } from '@anicanon/sakuga/anicanonkit';
export default function CanvasStageExample() {
return (
<CanvasStage
image="/art/eba-cinema.webp"
box={{ x: 20, y: 15, w: 50, h: 60 }}
height={200}
label="Bruce"
onBox={() => {}}
/>
);
}PropsCanvasStageProps
imagestringimageStylestringaltstringboxBoxratiostringheightnumberlabelstringchildrenReactNodeclassNamestringonBox(box: Box) => voidMakes the box one Tab stop: arrows move it a percent, Shift and an arrow resize it. Called with the new box.
Types
type Box = { x: number; y: number; w: number; h: number; };
Each token reads a role, and the role lands on a value in each theme. Change the role and every component that reads it follows.
Space and shape
stage-radiusradius-lg16px
stage-gapgap-lg12px
stage-paddinginset-lg16px
stage-edge-widthline-hairline1px
stage-mask-inset-ring-widthline-hairline1px
stage-sel-outline-widthline-strong2px
stage-h-sizeits own value
8px
stage-h-radiusradius-xs4px
stage-h-ring-widthline-strong2px
stage-forced-handle-ring-widthline-strong2px
Motion
stage-sel-sel-in-animationmotion-selectsk-sel-in 100ms cubic-bezier(0, 0, 0, 1)
Checked automatically with axe-core 4.11.4 against WCAG 2.2 A and AA, on the live preview above, in light and dark, on 26 October 2026.
- Result
- No issues found, in light or in dark.
- By design
- The selection is a group named by
label(default "Selected item") and described by its position and size. WithonBoxit is an application (a "movable item"), so a screen reader in browse mode hands it the arrows, and one Tab stop: arrows move it a percent and Shift with an arrow resizes it from its right or bottom edge, each change said aloud. The handles are for the pointer, dragged to resize, and are hidden; dragging the box moves it as the arrows do. - Not tested
- The automated check doesn't test keyboard use, focus order or what a screen reader says. The lines above are the design system's own account of them.