Choose an entry point
pixi-silk ships one entry point per feature. See what the root import holds, what lives under ui, text, layout, glass, glow and webgpu, and when to import each.
Updated pixi-silk 1.0.1View as Markdown
The root import pixi-silk holds the drawing core. Everything else has its own entry point, so
an app that only draws shapes never downloads the text renderer or the editor widgets.
import { SilkGraphics } from 'pixi-silk';
import { SilkText } from 'pixi-silk/text';
import { SilkButton } from 'pixi-silk/ui/button';
The UI widgets, text, layout, glass, glow and the WebGPU shader are not in the root import. An
import of SilkText from pixi-silk fails to compile.
Core#
| Import | What it holds | Import it when |
|---|---|---|
pixi-silk | SilkGraphics, gradients (linear, radial, conic, along, mesh), createSilkApp, enableSilkBatching, Spring, damp, ease, colour and curve helpers | always |
pixi-silk/webgpu | enableWebGPU(), the WGSL shader | you create your own Pixi app with WebGPU. See Renderers |
pixi-silk/signal | signal, computed, watch, batch | you read or write widget state, which is kept in signals |
Text, layout and effects#
| Import | What it holds | Import it when |
|---|---|---|
pixi-silk/text | SilkText, silkLabel, SdfAtlas, text layout and caret helpers | you draw labels. See Text |
pixi-silk/layout | LayoutNode, a flex layout engine with no Pixi in it | you lay out boxes in a worker, a test or a server. See Layout engine |
pixi-silk/ui/layout | SmartContainer, FlexContainer, simulateViewport, layoutDebug | you place Pixi containers on a responsive screen. See Layout |
pixi-silk/glass | Glass, GlassFilter | you want frosted panels. See Glass & glow |
pixi-silk/glow | Glow, Aurora, neon, halo, shadowStack, light rays | you want neon, halos or light beams |
Interface widgets#
| Import | What it holds | Page |
|---|---|---|
pixi-silk/ui/button | SilkButton | Radial menus & buttons |
pixi-silk/ui/radial | RadialMenu, bindRadialTrigger | Radial menus & buttons |
pixi-silk/ui/dock | ButtonDock | Radial menus and buttons |
pixi-silk/ui/odometer | Odometer | Interaction and motion |
pixi-silk/ui/pill | ValuePill | Gizmos and selection |
pixi-silk/ui/gesture | trackGesture | Interaction & motion |
pixi-silk/ui/textedit | TextEditor | Editing text |
Editor kit#
The editor kit is experimental in 1.0: its API may change in a minor release.
| Import | What it holds | Page |
|---|---|---|
pixi-silk/ui/camera | Camera, ZoomControl | Canvas & rulers |
pixi-silk/ui/grid | CanvasGrid | Canvas & rulers |
pixi-silk/ui/ruler | Ruler | Canvas & rulers |
pixi-silk/ui/guides | Guides | Canvas & rulers |
pixi-silk/ui/marquee | Marquee | Canvas & rulers |
pixi-silk/ui/measure | Measure, the redlines between layers | Canvas & rulers |
pixi-silk/ui/spacing | SpacingMarkers, findSpacing | Canvas & rulers |
pixi-silk/ui/gizmo | TransformGizmo | Gizmos & selection |
pixi-silk/ui/outline | SelectionOutline and quad helpers | Gizmos & selection |
pixi-silk/ui/group | SelectionGroup | Gizmos & selection |
pixi-silk/ui/snap | SnapEngine, SnapGuides | Gizmos & selection |
pixi-silk/selection | Selection, bindOutline, bindGizmo, bindMeasure | Gizmos & selection |
pixi-silk/history | History, recordGizmo, recordSignals, bindHistoryKeys | Gizmos & selection |
pixi-silk/path | Bezier path data and edits, parseSvgPath, pathToSvg | Path editing |
pixi-silk/ui/pathgizmo | PathGizmo, PenTool | Path editing |
pixi-silk/ui/color | ColorPicker, ColorWheel, OklchPicker, Eyedropper, swatches | Colour pickers |
pixi-silk/ui/halo | ContextHalo | Editor tools |
pixi-silk/ui/brush | BrushCursor | Editor tools |
pixi-silk/ui/modes | ModeSwitcher, SegmentedSwitch | Editor tools |
pixi-silk/ui/keys | isKeyDown, shiftDown, altDown, modDown, onKey | Editor tools |
pixi-silk/ui/dial | JogDial, Scrubber | Dials & timeline |
pixi-silk/ui/timeline | MiniTimeline | Dials & timeline |
pixi-silk/ui/arc | angle helpers and AngleAccumulator for dials | Dials & timeline |
pixi-silk/ui/panel | Panel, PanelDock, ScrollView | Panels |
pixi-silk/ui/layers | LayerTree, pixiTreeAdapter | Panels |
pixi-silk/ui/inspector | Inspector and its fields | Panels |
pixi-silk/ui/minimap | Minimap | Panels |
Everything at once#
pixi-silk/ui re-exports every widget above, plus pixi-silk/selection, pixi-silk/history and
pixi-silk/path. It is handy in a prototype. In an app, import from the widget’s own path so the
bundle holds only the widgets you use.
The package has no side effects, so a bundler drops the widgets you do not use from either import. The narrow paths make that independent of how well your bundler tree-shakes.
API reference: SilkGraphics, createSilkApp