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

@bobril/pele

v0.1.0

Published

Pele Mermaid diagram component for Bobril

Readme

Bobril Pele Component

Bobril wrapper for Pele, rendering Mermaid syntax as SVG.

npm install @bobril/pele

Usage

import * as b from "bobril";
import { Pele } from "@bobril/pele";

b.init(() => (
    <b.ErrorBoundary fallback={(e) => <div>{(e as Error).message}</div>}>
        <Pele style={{ maxWidth: 800 }}>{`graph TD; A-->B;`}</Pele>
    </b.ErrorBoundary>
));

Rendering is synchronous, so Suspense is optional. An existing Suspense boundary can stay in place. Invalid diagrams throw PeleError, which can be caught by ErrorBoundary.

Component props

  • children: string: Mermaid diagram source.
  • style?: b.IBobrilStyles: Bobril styles, including Pele CSS variables.
  • options?: RenderOptions: per-diagram options overriding the global options.

Render results are memoized per component. Replace an options object when changing its values. Each component receives a unique SVG ID prefix; setting idPrefix yourself overrides this protection. maxWidth controls layout width; container resizing does not automatically recalculate the layout.

Global settings

import * as pele from "@bobril/pele";

pele.setOptions({ fontSize: 16, links: false, images: false });
pele.setTheme("dark"); // "default" | "dark"
pele.setDarkMode(false); // returns to "default"

setOptions() replaces the global render options and refreshes mounted diagrams. Call setOptions({}) to restore Pele's defaults. Component options take precedence. The package re-exports RenderOptions, RenderResult, and PeleError. See the Pele API for all render options.

The default theme inherits Pele CSS variables from your application. The dark theme supplies a dark palette. Component styles override that palette:

<Pele style={{ "--pele-bg": "#101010", "--pele-fg": "#eeeeee", "--pele-surface": "#252525" }}>
    {`flowchart LR; A-->B;`}
</Pele>

Migration from @bobril/mermaid

Mermaid is an alias for Pele, so existing component calls can keep their name:

import * as mermaid from "@bobril/pele";

<mermaid.Mermaid style={{ maxWidth: 800 }}>{`graph TD; A-->B;`}</mermaid.Mermaid>;

children, style, setTheme("default" | "dark"), and setDarkMode() have equivalent entry points. Mermaid-specific themes, MermaidConfig, setSecurityLevel(), and setLogLevel() are not provided. Use Pele options and CSS variables instead. Diagram layout and supported syntax follow Pele's compatibility.

Development

npm install
npm run typecheck
npm test
npm run build

The build writes the interactive example to docs/.