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

@batthewz/response-ui-react-components

v0.1.0

Published

React component library for the response-ui design system. Pairs with @batthewz/response-ui-css.

Downloads

157

Readme

@batthewz/response-ui-react-components

React 19 component library for the response-ui design system. ~60 components, accessibility-first, zero CSS-in-JS — all styling comes from @batthewz/response-ui-css (Tailwind v4 + design tokens). Router-agnostic via an injection adapter, headless auth gating.

Install

bun add @batthewz/response-ui-react-components @batthewz/response-ui-css \
  react react-dom @floating-ui/react lucide-react
bun add -D tailwindcss @tailwindcss/vite

Use

/* src/app.css */
@import "@batthewz/response-ui-css";
import { Button, Card, Stack } from "@batthewz/response-ui-react-components";

export function Hello() {
  return (
    <Card>
      <Stack gap="r3">
        <h2 className="text-h3">Hello</h2>
        <Button variant="primary">Continue</Button>
      </Stack>
    </Card>
  );
}

Theming

import { useTheme } from "@batthewz/response-ui-react-components";

const { theme, setTheme, themes } = useTheme();
setTheme("grimdark"); // also: "events", "tech", "default"

Custom theme: write a CSS file matching the theme contract, @import it after @batthewz/response-ui-css, then:

const { setTheme } = useTheme({ themes: ["default", "aurora"] as const });
setTheme("aurora");

Router adapter — wire your router once

Components like AppShell.SidebarLink and Breadcrumbs.Item render navigational links. Wrap your app once at the root with the adapter:

import {
  RouterAdapterProvider,
  type RouterLinkComponent,
  type RouterLinkProps,
} from "@batthewz/response-ui-react-components";
import { forwardRef } from "react";
import { BrowserRouter, Link as RRLink, useLocation } from "react-router-dom";

const AdapterLink: RouterLinkComponent = forwardRef<HTMLAnchorElement, RouterLinkProps>(
  function AdapterLink({ to, replace, children, ...rest }, ref) {
    return <RRLink ref={ref} to={to} replace={replace} {...rest}>{children}</RRLink>;
  },
);
const adapter = { Link: AdapterLink, usePathname: () => useLocation().pathname };

export function App() {
  return (
    <BrowserRouter>
      <RouterAdapterProvider value={adapter}>
        {/* your routes */}
      </RouterAdapterProvider>
    </BrowserRouter>
  );
}

If you skip the provider, links fall back to plain <a href> — fine for static / non-SPA.

Auth gating — headless RequireAuth

The package ships a router/auth-agnostic RequireAuth that takes a status string and renders accordingly:

import { RequireAuth } from "@batthewz/response-ui-react-components";
import { Navigate } from "react-router-dom";
import { useSession } from "your-auth-library";

export function AuthGuard({ children }) {
  const { data: session, isPending } = useSession();
  const status = isPending ? "loading" : session ? "authenticated" : "unauthenticated";
  return (
    <RequireAuth status={status} unauthenticatedFallback={<Navigate to="/login" replace />}>
      {children}
    </RequireAuth>
  );
}

Adding custom Tailwind tokens

If you add custom design tokens (e.g. bg-brand-foo), extend the package's tailwind-merge config so cn() knows how to merge them:

import { tailwindMergeExtension } from "@batthewz/response-ui-react-components";
import { extendTailwindMerge } from "tailwind-merge";

export const twMerge = extendTailwindMerge({
  extend: {
    theme: {
      ...tailwindMergeExtension.theme,
      color: [...tailwindMergeExtension.theme.color, "brand-foo"],
    },
  },
});

What ships

  • UI (36): Accordion, Alert, AppShell, Avatar, AvatarUpload, Badge, Breadcrumbs, Button, Card, Carousel, DataTable, Dialog, DropdownMenu, EmptyState, ErrorBoundary, FileUpload, Hero, IconButton, MasonryGrid, MediaCard, Pagination, Popover, Portal, ProgressBar, Skeleton, Spinner, Spotlight, StatCard, Swimlane, Table, Tabs, Text, ThemeSwitcher, Timeline, Toast (+ToastProvider/useToast), Tooltip
  • Form (10): Checkbox, Field, FieldError, FormActions, Input, Label, Radio, SearchInput, Select, Textarea
  • Layout (6): Center, Container, Divider, Row, Spacer, Stack
  • Animation (5): AnimatePresence, Parallax, ScrollReveal, Stagger, ViewTransition (+useViewTransition)
  • Guards (1): RequireAuth (headless)
  • Router (1): RouterAdapterProvider, useLink, usePathname
  • Hooks: useActiveSection, useClickOutside, useDebounce, useDocumentTitle, useFloating, useFocusTrap, usePrefersReducedMotion, useRovingFocus, useTheme
  • Util: cn, tailwindMergeExtension, twMerge, mergeRefs, formatBytes

Subpath imports for tree-shaking

Once published, deep imports are supported:

import { Button } from "@batthewz/response-ui-react-components/components/ui/Button";
import { useDebounce } from "@batthewz/response-ui-react-components/hooks/use-debounce";

In dev (workspace links), import from the root barrel — both work.

License

MIT.