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

@orangecheck/vote-react

v0.1.0

Published

React components for OC Vote — render live tallies as badges or full poll cards, drop into any browser app in one line.

Readme

@orangecheck/vote-react

Drop-in React components for OC Vote. Embed a live tally anywhere in three lines.

npm i @orangecheck/vote-react react

Components

<OcPoll pollId="…" />

A full poll card — question, option bars, turnout, status pill, "cast a ballot" CTA that opens vote.ochk.io/p/<id> in a new tab. Live-refreshes every 60s by default.

import { OcPoll } from '@orangecheck/vote-react';

<OcPoll pollId="3054390f047f2703186943a41178bc15931500b5139229517f26e56282026ee5" />

<OcTallyBadge pollId="…" />

A compact inline pill showing the top option + its percentage. Use in sidebars, profile cards, feed rows.

import { OcTallyBadge } from '@orangecheck/vote-react';

<OcTallyBadge pollId="3054390f…" theme="dark" />

useTally(pollId, opts?)

The underlying hook, for custom rendering.

import { useTally } from '@orangecheck/vote-react';

function MyPoll({ id }: { id: string }) {
    const { data, error, loading, refetch } = useTally(id, { refreshMs: 30_000 });
    if (loading) return <Spinner />;
    if (error) return <Error msg={error.message} />;
    if (data?.state === 'awaiting_reveal') return <Pending />;
    return <TallyView tallies={data!.tallies!} />;
}

Props (shared)

| Prop | Type | Default | Meaning | |---|---|---|---| | pollId | string | — | 64-hex poll id | | theme | 'light' \| 'dark' | 'light' | Colour theme | | baseUrl | string | https://vote.ochk.io | Override for self-hosted /api/tally | | refreshMs | number | 60000 | Auto-refresh interval; 0 to disable | | initialData | TallyResponse | — | SSR hydration payload (skip initial fetch) | | className | string | — | Outer element class | | style | CSSProperties | — | Inline style override |

<OcPoll> additionally accepts hideCta (boolean, default false) to render as read-only without the "cast a ballot" link.

Why it's read-only

Voting requires a BIP-322 signature from the user's Bitcoin wallet. That's handled by vote.ochk.io/p/<id> (or your own fork of oc-vote-web) which knows how to talk to UniSat, Xverse, Leather, OKX, Phantom, etc. The CTA in <OcPoll> links there.

For headless poll creation / voting / revealing, use @orangecheck/vote-cli instead.

Styling

Zero CSS dependencies — every component uses inline styles. The built-in themes match the OC family's palette (near-black + bitcoin-orange in dark; near-white + orange in light). Override with className + your own CSS, or pass style for per-instance tweaks.

SSR

Works under Next.js App Router (both packages are 'use client'-marked) and Pages Router. If you want to skip the initial fetch for faster first paint, pre-fetch on the server and pass initialData:

// Next.js server component / getServerSideProps
const res = await fetch(`https://vote.ochk.io/api/tally?poll=${id}`);
const initialData = await res.json();

// render:
<OcPoll pollId={id} initialData={initialData} />

Verification

This package trusts the baseUrl endpoint. For high-value decisions, pair it with an independent run of @orangecheck/vote-cli tally <id> — the CLI re-verifies every BIP-322 signature and re-runs the pure tally function. If the two disagree, the CLI is authoritative.

License

MIT. See LICENSE.

Related