npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ripl/svg

v1.4.0

Published

SVG rendering context for Ripl

Downloads

309

Readme

@ripl/svg

npm license size

The SVG rendering context for Ripl: draws the same elements into a live SVG DOM tree instead of a canvas bitmap.

Features

  • One import to switch — replace createContext from @ripl/web with this package's, and the elements, scenes, animations and events are untouched.
  • Reconciled DOM updates — each render pass diffs a virtual tree against the real SVG nodes and touches only what changed, rather than rebuilding the subtree.
  • Inspectable output — the result is real markup you can style with CSS, inspect in devtools, export, or hand to a print pipeline.
  • Native <defs> for paint — linear and radial gradients, pattern tiles, clip paths, shadow filters and text paths become <defs> entries, cached by id and swept when unused. Conic gradients, which SVG has no element for, fall back to a solid colour.
  • Full element parity — paths, text, text-on-a-path, images, transforms, clipping and hit testing all behave as they do on Canvas.
  • Snapshot export — SVG markup, an image/svg+xml object URL, or rasterized ImageData.

Installation

# npm
npm install @ripl/svg

# yarn
yarn add @ripl/svg

# pnpm
pnpm add @ripl/svg

Install it alongside @ripl/web, which supplies the elements, scene, renderer and browser platform bindings.

Quick start

import {
    createContext,
} from '@ripl/svg';

import {
    createCircle,
    createRect,
} from '@ripl/web';

const context = createContext('.mount-element');

createCircle({
    fill: '#3a86ff',
    stroke: '#1a56db',
    lineWidth: 2,
    cx: context.width / 3,
    cy: context.height / 2,
    radius: Math.min(context.width, context.height) / 4,
}).render(context);

createRect({
    fill: 'linear-gradient(45deg, #ff006e, #fb5607)',
    x: context.width / 2,
    y: context.height / 4,
    width: context.width / 3,
    height: context.height / 2,
}).render(context);

Key API

| Export | What it does | | --- | --- | | createContext | Binds an SVGContext to a selector or element | | SVGContext | The context itself, for typing and subclassing | | SVGPath / SVGText / SVGImage | The SVG-backed path, text and image primitives | | isSupportedSVGGradient | Whether a parsed gradient has a native SVG element |

Related packages

  • @ripl/web — the browser entry point supplying elements, scene and renderer
  • @ripl/canvas — the same API, rasterizing to a canvas instead
  • @ripl/core — the elements and scene graph this context draws
  • @ripl/charts — every chart type renders through this context too

Documentation

Guides, live demos and the full API reference are at ripl.run/docs/core/contexts/svg.

License

MIT