pixi-silk
1.0.1#
Patch Changes#
-
#12
4ef6597Thanks @igaming-bulochka! - SilkGraphics render on Chrome and Edge for Windows again. ANGLE’s Direct3D 11 backend could not compile the WebGL2 program and lost the context: FXC failed on the discard inside the path stroke loop. The shader now discards after the loop. -
#12
4ef6597Thanks @igaming-bulochka! -createSilkApp({ preference: 'webgpu' })retries on WebGL2 when WebGPU is offered but fails to start, and logs a warning, instead of rejecting.
1.0.0#
Major Changes#
- pixi-silk 1.0. The core API (
SilkGraphics,createSilkApp, gradients, paint effects,pixi-silk/glass,pixi-silk/glow,pixi-silk/text,pixi-silk/layout,pixi-silk/webgpu) is now stable and follows semver. The editor kit underpixi-silk/ui(camera, rulers, guides, marquee, gizmos, text editor, path gizmo, panels and the other editor widgets) is marked@experimentaland may change in a minor release. The package ships agent skills inskills/.
Fixes in 1.0.0#
Glasspanes rotate and take an uneven scale: the shape, rim and refraction follow the transform on WebGL2 and WebGPU.GlassFilter.setRotation()sets the angle when you use the filter alone.ChannelSlidersbuilt without amodelshare one model across their tracks and expose it asmodel.MiniTimelinetakesfontSize,fontFamilyand alabelfactory for its ruler numbers.Camerasets the CSStouch-actionof its element tononewhile it lives, so a pinch zooms the camera, not the page. Two-finger flings glide at finger speed.createSilkAppends drags when the browser cancels a pointer, so a touch the page takes over for a scroll no longer leaves a scrubber, gizmo or panel stuck mid-drag.SdfAtlasmoves to a new texture when it grows and frees the old one after the frame, which removes a WebGPU “Destroyed texture used in a submit” warning.
Minor Changes#
-
New
pixi-silk/ui/camera.Camerapans and zooms a world container like a design tool: pinch, ctrl or cmd + wheel, scroll, middle, right and Space drags, two-finger touch and flings.fit,zoomToandcenterOnanimate, and zoom and position are signals.ZoomControldraws a- 100% +bar for it.New
pixi-silk/ui/measure.Measuredraws Figma-style redlines between two objects and aW x Hsize badge, in world units at any zoom. -
Cameraleaves plain scrolls to a scrolling page until the canvas is clicked (pageScroll, defaultauto), andfit()takes padding per side to centre content between docked panels. The layout debug overlay stays on its boxes under a camera. -
Canvas tools for the camera, each its own entry point.
pixi-silk/ui/grid:CanvasGriddraws an infinite lines or dots grid whose levels fade with the zoom, two silk shapes per level.pixi-silk/ui/ruler:Rulerdraws top and left rulers with 1, 2, 5 labels, a selection band and a cursor marker.pixi-silk/ui/guides:Guidesare dragged out of the rulers, snap to aSnapEngineand feed it back.pixi-silk/ui/marquee:Marqueeis rubber-band selection on empty canvas, with Shift to add, Alt to take away, and intersect or contain modes.pixi-silk/ui/group:SelectionGrouplets theTransformGizmomove, resize and rotate several objects about a common pivot.pixi-silk/ui/spacing:findSpacingandSpacingMarkersshow Figma-style equal gaps and alignment lines.Cameragainsworldandelementgetters andstate.widthandstate.heightsignals that follow resizes. -
Add effects drawn from the distance field in the same draw call, plus glass and glow.
- Fills and strokes take
spread(grow before blur),blend: 'add'(plus lighter) and a progressiveblur: { from, to, angle }. innerShadowdraws one or more inset shadows with offset, blur, spread, colour and blend on any closed shape.mesh(cols, rows, colors)is a smooth gradient mesh, blended in OKLab.pixi-silk/glass: a frosted glass pane with backdrop blur, refraction, dispersion, a lit rim and grain.pixi-silk/glow: stacked glow passes, neon and halo recipes, an animated aurora, light rays and spectrum helpers.
- Fills and strokes take
-
Strokes support
join: 'miter' | 'bevel' | 'round'andmiterLimit, as in Canvas 2D. The default is nowmiter, so stroked rects without a radius have sharp corners. Usejoin: 'round'for the old look. A stroked path is one distance field, with caps, joins and dashes, and no double blending at its corners.union: trueon a fill or stroke paints several shapes as one, with no seam where they meet. The gizmo arrows and handles use it.enableSilkBatching()draws runs of consecutive SilkGraphics in one draw call.new SilkGraphics({ batch: false })opts an object out. -
New
pixi-silk/layout.LayoutNodeis a small flex layout engine with no Pixi in it. It covers direction, wrap, gap, padding, margins, grow and shrink with min and max, justify and align, percents, aspect ratio, absolute anchors and measured leaves. Layout is incremental: clean subtrees are skipped and measured leaves cache their size.New
pixi-silk/ui/layout.SmartContainerplaces a design box in the window fromportraitDataandlandscapeDatarecords, for portrait and landscape screens against a reference resolution. It adds named breakpoints, a viewport source instead of window listeners, safe-area insets,extendWidthandextendHeight, and an optional glide when the breakpoint changes.FlexContainerlays out children with the flex engine, inside a SmartContainer or on its own, with fit modes, text shrink-to-fit, responsive styles and spring transitions.layoutDebugdraws boxes, breakpoints, scales, anchors, safe areas, padding, gaps and overflow, with a hover readout.simulateViewportpreviews device sizes inside a page. -
New editor panels, drawn on the canvas with no DOM. Each has its own entry point.
pixi-silk/ui/panelhasPanel: a title bar, a body that scrolls, edges to resize and a chevron that folds it. Drag it by the title, and drop it near a screen edge or corner to dock it there.ScrollViewscrolls with glide, flings and a slim scrollbar.panelHitTestkeeps camera wheels and pans off the panels.pixi-silk/ui/layershasLayerTree, a virtualised layer list over any tree through aTreeAdapter. It selects with aSelectionstore, drags rows to reorder and reparent them, renames in place and moves with the arrow keys.pixiTreeAdaptershows a Pixi scene graph.pixi-silk/ui/inspectorhasInspector, built from a schema of number, text, toggle, choice, colour and vector fields in folding sections. It edits objects or signals, shows Mixed for differing values and records one undo step per drag.pixi-silk/ui/minimaphasMinimap, a view of a camera’s world with a frame you drag, click and scroll.Cameratakes anignoreoption for points it should leave alone. -
fill()now fills free-form paths (poly(),moveToand curves) as one exact shape, even-odd, so blur, spread, progressive blur and inner shadows work on any outline. Pointer hits follow the outline.neon()follows the five-layer Figma recipe. New inpixi-silk/glow:bolt(),drop()andshadowStack(). -
Add
pixi-silk/text: text that stays sharp at any zoom, drawn from signed distance fields.SilkTextis a display object with the PixiJSTextoptions you use for labels: font, size, weight, style, fill (colour or gradient), letter spacing, line height, alignment and word wrap. It is one instanced draw call per text, on WebGL2 and WebGPU.- Outlines, drop shadows, glows, weight changes and tabular numbers come from the same distance field, with no filters.
SdfAtlasbakes glyphs of any CSS font at runtime with Canvas2D and an exact distance transform, into one shared texture that grows as needed.layoutTextandsdfFromAlphaare exported too.ValuePilltakes alabelfactory. PasssilkLabel()for pills that stay sharp under a zooming camera. Widgets keep PixiJSTextby default and never import SilkText on their own.
-
New
pixi-silk/selection.Selectionkeeps the selected items in order, the primary item and the hovered one as signals.bindOutline,bindGizmoandbindMeasuremake the widgets follow it with one call each.New
pixi-silk/history.Historyis an undo stack with transactions, merging, labels, a depth limit andcanUndoandcanRedosignals.recordSignalsmakes signal changes undoable without commands,recordGizmoturns each gizmo drag into one step, andbindHistoryKeysbinds cmd or ctrl + Z. Widgets take anyHistoryLike, so an app can bring its own store.New
pixi-silk/pathandpixi-silk/ui/pathgizmo. Bezier paths are plain data with helpers to draw, split, insert, delete and convert from and to SVG.PathGizmoedits them like a design tool, with a pen tool, and every edit is undoable. -
Shape operations.
fill({ op })andstroke({ op })combine the closed shapes of the active path withunion,subtract,intersectorexcludeinto one exact shape.boolean(op, a, b)combines what two callbacks draw and nests. The result is one instance with a sharp outline, and it takes strokes, gradients, blur, spread and inner shadows. Hit tests follow it.svgPath(d)reads an SVG path string into the active path, for fills, strokes and shape operations.Hit tests of hearts, stars and sectors now follow their exact shape instead of their bounds.
-
Add
pixi-silk/ui/textedit: text you can click and edit on the canvas, like a design tool text layer.TextEditorwraps aSilkTextwith a caret and rounded selection boxes drawn with silk, so both stay crisp under a zooming camera. The caret moves by grapheme cluster, blinks softly and holds still while you type.- Typing goes through a hidden
<textarea>at the caret, so input methods, dead keys, mobile keyboards, autocorrect, the emoji picker and the clipboard work. Composed text shows underlined. - Click, drag, Shift + click, double click for a word and triple click for a paragraph. Touch taps place the caret and a long press selects a word, with optional handles.
- Arrows, Home and End, word jumps, select all, word deletes, Enter, Tab and Escape. Undo merges consecutive typing, and the
historyoption shares the app’s undo stack. - Single-line inputs that scroll, text areas, placeholders,
maxLength, read-only text andTextEditor.chain()for Tab order. Eventsfocus,blur,input,changeandsubmit, and the same state as signals. SilkTextgainslayout,caretAt(),caretRect()andrangeRects().pixi-silk/textexports the layout hit testing (caretAtPoint,caretRect,rangeRects,lineOfIndex) and grapheme and word helpers. Layout lines and glyphs now carry their source offsets and caret stops.
-
Add tree-shakeable UI widgets, each under its own entry point.
pixi-silk/ui/radial: radial and marking menus with nested rings, angular falloff and per-device input profiles.pixi-silk/ui/buttonandpixi-silk/ui/dock: buttons that animate in and out and refuse input while moving, and a row that reflows as they hide.pixi-silk/ui/gizmo,pixi-silk/ui/outlineandpixi-silk/ui/snap: transform gizmos in every mode, animated selection outlines and smart guides.pixi-silk/ui/color: colour pickers that share one colour model. Hue triangle and square, wheel, OKLCH, channel sliders, swatches and an eyedropper.pixi-silk/ui/halo,pixi-silk/ui/brushandpixi-silk/ui/modes: a context halo, a brush cursor, a hold-to-show mode ring and a segmented switch.pixi-silk/ui/dial,pixi-silk/ui/timelineandpixi-silk/ui/odometer: jog dials, scrub fields, a mini timeline and rolling counters.pixi-silk/ui/gesture,pixi-silk/ui/arc,pixi-silk/ui/keysandpixi-silk/ui/pill: the shared building blocks.pixi-silk/signal: the tiny signal store the widgets keep their state in.
-
enableSilkBatching()batches on WebGPU too. Runs of SilkGraphics share one draw call under Pixi’s WebGPU renderer, with the same packing as on WebGL2 and the same pixels. It needs the WGSL shader fromenableWebGPU(), whichcreateSilkApploads for you. -
Render on Pixi’s WebGPU renderer. WebGL2 stays the default and the fallback.
- The uber shader has a WGSL port with the same shapes, strokes, dashes, effects and gradients as the GLSL one.
createSilkApp({ preference: 'webgpu' })uses WebGPU where the browser has it. It loads the WGSL shader on demand, so WebGL2 apps do not download it.pixi-silk/webgpuexportsenableWebGPU()for apps that create the Pixi application themselves.Glassnow frosts the backdrop on WebGPU too, instead of drawing a plain fill.
-
WebGPU draws joined path strokes and shape unions the same as WebGL2.
Measure,ZoomControl,RulerandGuidestake alabeloption. PasssilkLabel()frompixi-silk/textand their text is drawn with SilkText, sharp at any zoom.
Patch Changes#
-
The package ships agent skills in
skills/. Point your coding agent atnode_modules/pixi-silk/skills/pixi-silk/SKILL.md: it routes to skills for drawing, paint, app setup and rendering, text, layout, widgets, the editor kit and migrating from PixiJS Graphics. -
Glass no longer triggers a WebGL
GL_INVALID_OPERATIONwarning on its first frame over an opaque canvas. It skips that one frame while the back buffer turns on.The editor kit is marked experimental for 1.0: camera, measure, grid, ruler, guides, marquee, group, spacing, snap, halo, brush, modes, dial, timeline, textedit, the panels and pathgizmo. Their API may change in a minor release.
The JSDoc now states units, defaults and side effects, and fixes wrong facts. For example, the instance stride is 44 floats.
-
Stroked paths shade every pixel once in the hard cases too. A long translucent path that crosses itself far along its length no longer blends twice where it overlaps: each chunk of a path also checks the segments of other chunks near it. Fold-backs on chunk boundaries keep exact coverage. Square dash caps that run through a round corner keep the corner round.
0.1.0#
Minor Changes#
- First release.
SilkGraphics: analytic anti-aliased rects, squircles, circles, ellipses, arcs, sectors, lines, polylines (smoothed, tapered), paths, areas, hearts, stars, polygons and triangles, drawn as one instanced draw call per object. Fill + stroke with exact coverage partition, shader-side dashes, gaussian blur on any paint, energy-conserving hairlines, transform stack and CPU hit testing. - Gradients: linear, radial, conic and along-the-path, interpolated in OKLab (or linear / sRGB), baked into a half-float atlas and dithered at ±½ LSB.
createSilkApp: a PixiApplicationwhose backing store maps 1:1 to device pixels (even at fractional DPRs), follows DPR changes, keeps sub-pixel positions and makes filters inherit the screen resolution.- Motion helpers:
damp,dampAngle,Spring,ease. - ESM only, built one file per module and free of side effects, so bundlers keep only what an app imports.
SilkGraphicswith its shader is 14.8 kB gzipped and the motion helpers alone 0.4 kB. CommonJS code can stillrequire()the package on Node 20.19+ and 22.12+. - Works in Safari: the gradient atlas is uploaded as the premultiplied data it is.