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

@facter/ds-core

v1.33.1

Published

Facter Design System - Core components (Button, Input, Badge, Spinner, Loader)

Readme

@facter/ds-core

Core UI components for Facter Design System built with React, TypeScript, and Tailwind CSS.

Installation

npm install @facter/ds-core
# or
pnpm add @facter/ds-core

Peer Dependencies

npm install react react-dom framer-motion

Optional (for icons)

npm install lucide-react
# or
npm install react-icons

Setup

1. Configure Tailwind CSS

Add the design system to your tailwind.config.js:

module.exports = {
  content: [
    './src/**/*.{js,ts,jsx,tsx}',
    './node_modules/@facter/ds-core/dist/**/*.{js,mjs}',
  ],
  theme: {
    extend: {
      colors: {
        border: 'hsl(var(--border))',
        background: 'hsl(var(--background))',
        foreground: 'hsl(var(--foreground))',
        primary: {
          DEFAULT: 'hsl(var(--primary))',
          foreground: 'hsl(var(--primary-foreground))',
        },
        // ... add more as needed
      },
    },
  },
}

2. Configure CSS Variables

Create or update your globals.css:

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --border: 0 0% 89.8%;
    --primary: 24 100% 50%;
    --primary-foreground: 0 0% 98%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
  }

  /* Optional: Custom font */
  * {
    font-family: 'Your Custom Font', sans-serif;
  }
}

See theme.example.css for complete theme configuration.

3. Import Global Styles

In your app entry point:

import './globals.css'

Components

Button

5 variants, 4 sizes, icon support.

import { Button } from '@facter/ds-core'

<Button variant="default" size="md">Click me</Button>
<Button variant="destructive" size="lg">Delete</Button>

Input

Floating label, icon support, password toggle.

import { Input } from '@facter/ds-core'
import { Mail, Lock } from 'lucide-react'

<Input label="Email" icon={Mail} type="email" />
<Input label="Password" icon={Lock} type="password" required />

Icon Support: Works with any icon library (lucide-react, react-icons, heroicons, custom SVG).

Badge

7 color variants.

import { Badge } from '@facter/ds-core'

<Badge variant="success">Active</Badge>
<Badge variant="error">Failed</Badge>

Loader

5 animated variants with Provider, Hook, and helper function.

import { LoaderProvider, useLoader, Loader } from '@facter/ds-core'

// Option 1: With Provider + Hook
function App() {
  return (
    <LoaderProvider>
      <MyComponent />
    </LoaderProvider>
  )
}

function MyComponent() {
  const loader = useLoader()

  const handleClick = async () => {
    loader.show({ variant: 'pulse', message: 'Processing...' })
    await fetchData()
    loader.hide()
  }

  return <button onClick={handleClick}>Load</button>
}

// Option 2: Direct component
<Loader variant="spinner" show={true} message="Loading..." />

Customization

Theme Colors

Each project can define its own brand colors in CSS variables:

:root {
  --primary: 24 100% 50%; /* Orange for Facter */
  /* or */
  --primary: 220 91% 50%; /* Blue for another project */
}

Custom Fonts

@layer base {
  * {
    font-family: 'Neue Haas Grotesk Display Pro', sans-serif;
  }
}

Or in tailwind.config.js:

theme: {
  extend: {
    fontFamily: {
      sans: ['Neue Haas Grotesk Display Pro', 'sans-serif'],
    },
  },
}

Documentation

Full documentation and interactive examples available in Storybook.

License

MIT