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

@hfu.digital/loopkit-react

v2026.4.2

Published

React hooks and components for LoopKit flashcard engine — headless-first with pre-styled defaults

Downloads

450

Readme

@hfu.digital/loopkit-react

React hooks and pre-styled components for LoopKit flashcard engine. Headless-first design — use the hooks directly or the included components.

Installation

bun add @hfu.digital/loopkit-react

Setup

Wrap your app with LoopKitProvider:

import { LoopKitProvider } from '@hfu.digital/loopkit-react';
import '@hfu.digital/loopkit-react/styles.css';

function App() {
    return (
        <LoopKitProvider apiUrl="/api/loopkit">
            {/* Your app */}
        </LoopKitProvider>
    );
}

Pass a custom fetcher for authentication:

<LoopKitProvider
    apiUrl="/api/loopkit"
    fetcher={(url, init) =>
        fetch(url, { ...init, headers: { ...init?.headers, Authorization: `Bearer ${token}` } })
    }
>

Review Session

Pre-styled component

import { ReviewSession } from '@hfu.digital/loopkit-react';

<ReviewSession
    deckId="deck-123"
    onComplete={(summary) => console.log('Done!', summary)}
/>

Headless hook

import { useReviewSession } from '@hfu.digital/loopkit-react';

function MyReviewUI() {
    const session = useReviewSession();

    return (
        <div>
            <button onClick={() => session.startSession('deck-123')}>Start</button>
            {session.renderedContent && (
                <div dangerouslySetInnerHTML={{ __html: session.renderedContent.front }} />
            )}
            <button onClick={session.showAnswer}>Show Answer</button>
            <button onClick={() => session.grade('good')}>Good</button>
        </div>
    );
}

Components

| Component | Description | |-----------|-------------| | <ReviewSession> | Full study session with progress bar, card viewer, grade buttons | | <CardViewer> | Renders front/back of a card | | <GradeButtons> | Again/Hard/Good/Easy buttons with interval previews | | <SessionComplete> | End-of-session summary | | <DeckList> | List of decks | | <DeckOverview> | Single deck with counts and "Study Now" button | | <DeckTree> | Hierarchical deck browser | | <CardEditor> | Create/edit notes with dynamic field inputs | | <StudyStats> | Retention, streak, forecast charts |

Hooks

| Hook | Description | |------|-------------| | useReviewSession() | Full session state machine | | useDeck(id) | Deck + counts | | useDecks() | All decks | | useDeckTree() | Hierarchical deck tree | | useCard(id) | Card + rendered content | | useCardEditor() | Create/update notes | | useNoteTypes() | Available note types | | useStats(deckId) | Deck statistics | | useImport() | CSV/JSON import | | useExport() | CSV/JSON export | | useTags() | All tags |

Accessibility

All pre-styled components include proper ARIA attributes:

  • Progress bars use role="progressbar" with aria-valuenow/aria-valuemin/aria-valuemax
  • Loading states use role="status"
  • Error messages use role="alert"
  • Grade distribution and forecast charts include aria-label descriptions

Theming

Override CSS custom properties:

:root {
    --loopkit-primary: #8b5cf6;
    --loopkit-grade-again: #dc2626;
    --loopkit-grade-hard: #ea580c;
    --loopkit-grade-good: #16a34a;
    --loopkit-grade-easy: #2563eb;
    --loopkit-bg: #ffffff;
    --loopkit-text: #111827;
    --loopkit-border: #d1d5db;
    --loopkit-radius: 12px;
    --loopkit-font: 'Inter', sans-serif;
}

License

MIT