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

@spacedrive/primitives

v0.2.3

Published

Primitive UI components for SpaceUI

Downloads

372

Readme

@spacedrive/primitives

Primitive UI components built on Radix UI with Tailwind CSS styling.

Installation

bun add @spacedrive/primitives @spacedrive/tokens
# or
npm install @spacedrive/primitives @spacedrive/tokens

Peer dependencies:

  • react ^18.0.0 || ^19.0.0
  • react-dom ^18.0.0 || ^19.0.0
  • tailwindcss ^4.1.0

Setup

  1. Configure your CSS entrypoint

    @import '@spacedrive/tokens/theme';
  2. Import CSS

    @import '@spacedrive/tokens/css';

Usage

import { Button, Card, Dialog, Input, Badge } from '@spacedrive/primitives';

function MyComponent() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Welcome</CardTitle>
      </CardHeader>
      <CardContent className="space-y-4">
        <Input placeholder="Enter your name" />
        <Button>Get Started</Button>
      </CardContent>
    </Card>
  );
}

Components

Interactive

  • Button - Multiple variants (default, subtle, outline, dotted, gray, accent, colored, bare)
  • Input - Form input with error states
  • Checkbox - Accessible checkbox with Radix
  • Switch - Toggle switch with 3 sizes
  • Slider - Range slider with marks support
  • RadioGroup - Radio button groups

Overlay

  • Dialog - Modal dialogs with animations
  • Popover - Floating content panels
  • Tooltip - Hover tooltips
  • DropdownMenu - Contextual menus
  • ContextMenu - Right-click menus

Navigation

  • Tabs - Tabbed interfaces
  • Select - Dropdown selects
  • Dropdown - Simple expanding dropdowns

Display

  • Badge - Status badges (6 variants, 2 sizes)
  • Card - Container with header/content/footer
  • Banner - Alert banners (5 variants)
  • Toast - Notification toasts
  • Loader - Loading spinners and dots
  • Divider - Horizontal/vertical dividers
  • Typography - Text components (6 heading, 3 body)
  • Shortcut - Keyboard shortcut display

Form

  • NumberStepper - Increment/decrement with min/max
  • FilterButton - Toggle buttons for filters
  • ToggleGroup - Radio-like button groups
  • SearchBar - Search inputs with icons

Progress

  • ProgressBar - Linear progress (with variants)
  • CircularProgress - Circular/spinner progress

Layout

  • Resizable - Resizable panel groups
  • Collapsible - Expand/collapse sections
  • TopBarButton - Top bar navigation buttons

Component API

All components follow consistent patterns:

Variants with CVA

Components use class-variance-authority for variants:

import { buttonVariants } from '@spacedrive/primitives';

// Use variants directly
<button className={buttonVariants({ variant: 'subtle', size: 'sm' })}>
  Small Subtle
</button>

Ref Forwarding

All interactive components support ref forwarding:

import { useRef } from 'react';
import { Button } from '@spacedrive/primitives';

function MyComponent() {
  const buttonRef = useRef<HTMLButtonElement>(null);
  return <Button ref={buttonRef}>Click me</Button>;
}

ClassName Composition

Components compose className with internal styles:

<Button className="w-full mt-4">
  {/* Classes are merged: internal + "w-full mt-4" */}
</Button>

Design Principles

  1. Accessible - Built on Radix UI primitives
  2. Composable - Small, focused components that compose
  3. Theme-agnostic - Uses semantic color classes
  4. No business logic - Purely presentational
  5. Type-safe - Full TypeScript support

Customization

Overriding Styles

Use Tailwind classes to override:

<Button 
  variant="default"
  className="bg-purple-500 hover:bg-purple-600"  {/* Override colors */}
>
  Custom Button
</Button>

Creating Variants

Extend CVA variants:

import { cva } from 'class-variance-authority';

const myButtonVariants = cva(
  'base-styles',
  {
    variants: {
      size: {
        xs: 'px-2 py-1 text-xs',
        xl: 'px-6 py-3 text-lg',
      }
    }
  }
);

Browser Support

  • Chrome/Edge 88+
  • Firefox 78+
  • Safari 14+

Requires CSS custom properties support.

License

MIT © Spacedrive