Skip to content

Minimal API Examples

Read as Markdown

Start with one complete program, then follow its API links for exact options and limitations. Browser examples include live previews; type-level and host-specific examples are labeled explicitly. Every source uses public package imports.

  • Automatic JSX runtime: The production compiler emits jsx and jsxs calls for component values and fragments. (live preview)
  • Development JSX runtime: The development compiler emits jsxDEV calls with source-location metadata. (live preview)
  • Rounded and circular marks: Draw a circle, ellipse, rounded rectangle, arc, and wedge with typed props and styles. (live preview)
  • Polygon marks: Draw a rounded triangle, regular hexagon, and five-point star. (live preview)
  • Lines and authored paths: Combine polyline, axis-aligned strokes, mutable geometry, and SVG path data. (live preview)
  • Drawing composition: Group, cache, and clip a drawing, then add text and an embedded thumbnail. (live preview)
  • Typed event target: A geometric Canvas target routes pointer, mouse, touch, wheel, keyboard, input, clipboard, and drag events. (live preview)
  • Focus and arrow navigation: Two logical targets participate in Tab focus and directional keyboard navigation. (live preview)
  • Memoized hit paths: Rectangle, line, and SVG path hooks define three independent geometric click targets. (live preview)
  • Blur and cast a shadow: Compare an original multicolor subject with separate blur and silhouette-shadow treatments. (live preview)
  • Adjust brightness, contrast, and saturation: Compare brightness, contrast, and saturation independently against the same original subject. (live preview)
  • Shift a color treatment: Compare grayscale, hue rotation, and inversion independently against a colorful original. (live preview)
  • Warm and fade a shape: Compare sepia and raster opacity against an original, with a checkerboard revealing transparency. (live preview)
  • Refract and light water: Compare an original tiled subject, displacement, reflected light, and their combined result. (live preview)
  • Cancelable machine tasks: Run a state-owned task, observe completion, and release actors and listeners. (live preview)
  • State-owned animation: Move a circle with a machine-owned animation task that completes into the next state. (live preview)
  • Editable path geometry: Build a cubic path, convert it, and compare flattening and simplification utilities. (live preview)
  • Circular path factories: Create circle, ellipse, arc, and wedge Path2D shapes. (live preview)
  • Polygon path factories: Create rounded rectangles and polygons alongside regular and star shapes. (live preview)
  • Line and SVG paths: Construct a polyline and an SVG path from authored coordinates. (live preview)
  • Affine transforms: Compose translation and scaling, then transform geometry and a sample point. (live preview)
  • Quad and envelope warps: Warp a tile through a quadrilateral and between measured guide paths. (live preview)
  • Arc and path bending: Bend geometry around an arc and along a guide with explicit placement options. (live preview)
  • Mesh warp: Define a one-cell guide mesh and warp a circle through it. (live preview)
  • Shape measurements: Compare bounds, area, and mass for four common 2D shapes. (live preview)
  • Path-like shapes: Create curved, stroked, and polygonal shapes and transform them. (live preview)
  • Geometry queries: Check point containment, separation, overlap, contact, and casts. (live preview)
  • Live physics world: Mount a falling ball, inspect it, and control its body with buttons. (live preview)
  • World queries: Query a static collider by ray, moving shape, overlap, point, and bounds. (live preview)
  • Physics drawing components: Draw four physics shapes and move a custom kinematic collider. (live preview)
  • Physics events: Record collisions, sensor overlap, body sleep, and contact inspection. (live preview)
  • Deterministic physics test: Advance a public physics scene through controlled host frames. (live preview)
  • Interactive bitmap layer: Draw a dot into an OffscreenCanvas and route clicks through Pibbl’s event boundary. (live preview)
  • Three.js scene layer: Mount a lit Three.js cube with Pibbl target clicks and raycast picking. (live preview)
  • Three.js orbit controls: Drag a cube using OrbitControls connected to Pibbl-routed input. (live preview)
  • Animated sprite atlas: Generate a two-frame atlas, animate a shared sheet, and dispose it after unmounting. (live preview)
  • Sprite format adapters: Compare normalized Aseprite, TexturePacker, and application-owned atlas metadata. (live preview)
  • Text outline: Load an outline font, shape a text run, and paint its editable path with glyph metrics. (live preview)
  • fade enter and exit: Show and hide a captured Pibbl subtree with the fade transition. (live preview)
  • slide enter and exit: Show and hide a captured Pibbl subtree with the slide transition. (live preview)
  • zoom enter and exit: Show and hide a captured Pibbl subtree with the zoom transition. (live preview)
  • wipe enter and exit: Show and hide a captured Pibbl subtree with the wipe transition. (live preview)
  • blurReveal enter and exit: Show and hide a captured Pibbl subtree with the blurReveal transition. (live preview)
  • dissolve enter and exit: Show and hide a captured Pibbl subtree with the dissolve transition. (live preview)
  • bifrost enter and exit: Beam a transparent logo in and out with Bifrost, using a dark stage and space for its luminous trails. The first entrance runs automatically. (live preview)
  • hologram enter and exit: Project a spacecraft with swept wings, a transparent window, and detached exhaust shapes. Hologram follows the painted silhouette, not a filled rectangle. The first entrance runs automatically; Show and Hide replay either direction. (live preview)
  • embers enter and exit: Break a transparent logo into glowing Embers, with a dark stage and space for falling particles. The first entrance runs automatically. (live preview)
  • Define a custom transition: Render a captured subtree with a custom synchronous alpha curve. (live preview)

Documentation built with @pibbl/core 0.0.2, revision c321a83. ALPHA — NOT FOR PRODUCTION USE.