Skip to content
pixi-silk
GitHub repository
Learn

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#

ImportWhat it holdsImport it when
pixi-silkSilkGraphics, gradients (linear, radial, conic, along, mesh), createSilkApp, enableSilkBatching, Spring, damp, ease, colour and curve helpersalways
pixi-silk/webgpuenableWebGPU(), the WGSL shaderyou create your own Pixi app with WebGPU. See Renderers
pixi-silk/signalsignal, computed, watch, batchyou read or write widget state, which is kept in signals

Text, layout and effects#

ImportWhat it holdsImport it when
pixi-silk/textSilkText, silkLabel, SdfAtlas, text layout and caret helpersyou draw labels. See Text
pixi-silk/layoutLayoutNode, a flex layout engine with no Pixi in ityou lay out boxes in a worker, a test or a server. See Layout engine
pixi-silk/ui/layoutSmartContainer, FlexContainer, simulateViewport, layoutDebugyou place Pixi containers on a responsive screen. See Layout
pixi-silk/glassGlass, GlassFilteryou want frosted panels. See Glass & glow
pixi-silk/glowGlow, Aurora, neon, halo, shadowStack, light raysyou want neon, halos or light beams

Interface widgets#

ImportWhat it holdsPage
pixi-silk/ui/buttonSilkButtonRadial menus & buttons
pixi-silk/ui/radialRadialMenu, bindRadialTriggerRadial menus & buttons
pixi-silk/ui/dockButtonDockRadial menus and buttons
pixi-silk/ui/odometerOdometerInteraction and motion
pixi-silk/ui/pillValuePillGizmos and selection
pixi-silk/ui/gesturetrackGestureInteraction & motion
pixi-silk/ui/texteditTextEditorEditing text

Editor kit#

The editor kit is experimental in 1.0: its API may change in a minor release.

ImportWhat it holdsPage
pixi-silk/ui/cameraCamera, ZoomControlCanvas & rulers
pixi-silk/ui/gridCanvasGridCanvas & rulers
pixi-silk/ui/rulerRulerCanvas & rulers
pixi-silk/ui/guidesGuidesCanvas & rulers
pixi-silk/ui/marqueeMarqueeCanvas & rulers
pixi-silk/ui/measureMeasure, the redlines between layersCanvas & rulers
pixi-silk/ui/spacingSpacingMarkers, findSpacingCanvas & rulers
pixi-silk/ui/gizmoTransformGizmoGizmos & selection
pixi-silk/ui/outlineSelectionOutline and quad helpersGizmos & selection
pixi-silk/ui/groupSelectionGroupGizmos & selection
pixi-silk/ui/snapSnapEngine, SnapGuidesGizmos & selection
pixi-silk/selectionSelection, bindOutline, bindGizmo, bindMeasureGizmos & selection
pixi-silk/historyHistory, recordGizmo, recordSignals, bindHistoryKeysGizmos & selection
pixi-silk/pathBezier path data and edits, parseSvgPath, pathToSvgPath editing
pixi-silk/ui/pathgizmoPathGizmo, PenToolPath editing
pixi-silk/ui/colorColorPicker, ColorWheel, OklchPicker, Eyedropper, swatchesColour pickers
pixi-silk/ui/haloContextHaloEditor tools
pixi-silk/ui/brushBrushCursorEditor tools
pixi-silk/ui/modesModeSwitcher, SegmentedSwitchEditor tools
pixi-silk/ui/keysisKeyDown, shiftDown, altDown, modDown, onKeyEditor tools
pixi-silk/ui/dialJogDial, ScrubberDials & timeline
pixi-silk/ui/timelineMiniTimelineDials & timeline
pixi-silk/ui/arcangle helpers and AngleAccumulator for dialsDials & timeline
pixi-silk/ui/panelPanel, PanelDock, ScrollViewPanels
pixi-silk/ui/layersLayerTree, pixiTreeAdapterPanels
pixi-silk/ui/inspectorInspector and its fieldsPanels
pixi-silk/ui/minimapMinimapPanels

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