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

bxp-code

v1.0.1

Published

Drop-in React code blocks with Shiki highlighting, Prettier formatting, and zero config.

Downloads

43

Readme


Features

  • Shiki syntax highlighting — TextMate-grammar-based highlighting for 100+ languages
  • Prettier formatting on render — Automatically formats code before display
  • Dark & light themes — Built-in themes with easy customization
  • Copy to clipboard — One-click copy with visual feedback
  • Line numbers — Optional gutter (showLineNumbers)
  • Sticky headers — Pin the header/tab bar while scrolling long blocks (stickyHeader)
  • Multiple input methods — Render from code, File, or remote url
  • Tabbed code blocksBxpCodeTabs for multi-snippet containers
  • TypeScript-first — Full types exported for all public APIs

Install

npm install bxp-code
pnpm add bxp-code
yarn add bxp-code

Quick Start

BxpCode

import { BxpCode } from "bxp-code";

function App() {
  return (
    <BxpCode
      code={`console.log('Hello, World!');`}
      lang="javascript"
      fileName="hello.js"
      theme="dark"
      showLineNumbers
    />
  );
}

BxpCodeTabs

import { BxpCodeTabs } from "bxp-code";

function App() {
  return (
    <BxpCodeTabs
      tabs={[
        { lang: "bash", label: "npm", code: "npm install bxp-code" },
        { lang: "bash", label: "pnpm", code: "pnpm add bxp-code" },
        { lang: "bash", label: "yarn", code: "yarn add bxp-code" },
      ]}
      theme="dark"
    />
  );
}

Components

Full API documentation lives in docs/api/index.md and on the website: https://saqibbedar.github.io/bxp-code/bxp-code

BxpCode

Render a single highlighted + formatted code block.

Input (provide one):

  • code?: string
  • file?: File
  • url?: string
    Priority: code > file > url

Common props:

  • lang?: string (auto-detect)
  • fileName?: string (auto-detect)
  • theme?: "dark" | "light" (default "dark")
  • showHeader?: boolean (default true)
  • showCopyButton?: boolean (default true)
  • showLineNumbers?: boolean (default true)
  • stickyHeader?: boolean (default false)
  • stickyTop?: number (default 0)
  • headerColor?: string
  • backgroundColor?: string
  • className?: string
  • style?: CSSProperties
  • onError?: (error: Error) => void

BxpCodeTabs

Render multiple code blocks inside a tabbed container.

Tabs (BxpCodeTab) Each tab supports: lang (required), label?, and one of code? / file? / url? (+ optional fileName?).

Common props:

  • tabs: BxpCodeTab[] (required)
  • theme?: "dark" | "light" (default "dark")
  • showLineNumbers?: boolean (default true)
  • showCopyButton?: boolean (default true)
  • showHeader?: boolean (default true)
  • stickyHeader?: boolean (default false)
  • stickyTop?: number (default 0)
  • defaultTab?: number (default 0)
  • headerColor?: string
  • backgroundColor?: string
  • borderColor?: string
  • tabActiveColor?: string
  • tabActiveTextColor?: string
  • tabTextColor?: string
  • tabIndicatorColor?: string (default #e06b74)
  • copyButtonColor?: string
  • lineNumberColor?: string
  • className?: string
  • style?: CSSProperties
  • onError?: (error: Error) => void

Contributing

Contributions are welcome!

License

MIT — Made by Saqib Bedar