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

@alsaeedfayed/sa-ui-lib

v0.1.3

Published

UI Library & Shared Components

Readme

@alsaeedfayed/ui-lib

Design System & Shared UI Component Library built with React, Tailwind CSS, shadcn/ui, and SCSS.


Prerequisites

  • Node.js >= 18
  • pnpm (recommended) — install with npm i -g pnpm

Getting Started (Local Development)

1. Clone the repository

git clone https://github.com/alsaeedfayed/sa-ui-lib.git
cd sa-ui-lib

2. Install dependencies

pnpm install

3. Run the playground (dev server)

pnpm playground

This starts a Vite dev server with the playground app where you can test components locally with hot-reload.

4. Build in watch mode (optional)

If you want the library to rebuild automatically on every change:

pnpm dev

Building for Production

1. Clean previous build artifacts

pnpm clean

2. Run the build

pnpm build

This uses tsup to compile the library and outputs the following to the dist/ folder:

| Output | Description | | ----------------- | ------------------------------------ | | dist/index.js | CommonJS bundle | | dist/index.mjs | ESM bundle | | dist/index.d.ts | TypeScript declarations | | dist/index.css | Compiled styles (SCSS + CSS Modules) |

3. Verify the build

ls dist/

Available Scripts

| Script | Command | Description | | ----------------------- | ----------------------------------------------- | ------------------------------- | | pnpm playground | vite --config playground/vite.config.ts | Start the playground dev server | | pnpm dev | tsup --watch | Build the library in watch mode | | pnpm build | tsup | Production build | | pnpm clean | rm -rf dist | Remove build artifacts | | pnpm lint | eslint src/ | Lint source files | | pnpm playground:build | vite build --config playground/vite.config.ts | Build the playground |


Project Structure

src/
├── components/       # UI components (Button, etc.)
├── design-system/
│   ├── scss/         # SCSS variables, mixins, global styles
│   └── tokens/       # Design tokens (colors, spacing, typography)
├── lib/              # Utilities (cn, twMerge)
├── styles/           # Global style entry point
└── types/            # TypeScript type declarations

playground/           # Vite app for testing components locally

Installation (for consumers)

npm i @alsaeedfayed/sa-ui-lib

Usage in Next.js Apps

1. Import styles in your layout

// app/layout.tsx
import "@alsaeedfayed/ui-lib/styles";

2. Extend your Tailwind config

// tailwind.config.ts
import uiLibConfig from "@alsaeedfayed/ui-lib/tailwind.config";

const config = {
  presets: [uiLibConfig],
  content: [
    "./app/**/*.{ts,tsx}",
    "./node_modules/@alsaeedfayed/ui-lib/dist/**/*.{js,mjs}",
  ],
};

export default config;

---------------------------------------------------------

usage in next15

1-global.css

@import "tailwindcss" prefix(wm);

/_ Load theme (colors, fonts, spacing) from the UI lib's tailwind preset _/
@config "../../tailwind.config.ts";

/_ Scan the UI lib's compiled JS so Tailwind picks up classes like wm:bg-primary _/
@source "../../node_modules/@alsaeedfayed/sa-ui-lib/dist";

2-app.tsx

import "@/styles/globals.css";
import "@alsaeedfayed/sa-ui-lib/styles";
import type { AppProps } from "next/app";

export default function App({ Component, pageProps }: AppProps) {
  return <Component {...pageProps} />;
}

3-tailwind.config.ts

import type { Config } from "tailwindcss";
import uiLibConfig from "@alsaeedfayed/sa-ui-lib/tailwind.config";

const config: Config = {
  presets: [uiLibConfig],
  content: [
    "./src/pages/**/*.{ts,tsx}",
    "./src/components/**/*.{ts,tsx}",
    "./node_modules/@alsaeedfayed/sa-ui-lib/dist/**/*.{js,mjs}",
  ],
};

export default config;

4- start using components and classes

import { Button } from "@alsaeedfayed/sa-ui-lib";

export default function Home() {
  return (
    <div>
      Home
      <Button variant="primary" size="lg">
        Click Me
      </Button>
      <Button className="wm:w-full" variant="destructive" size="md">
        Delete Me
      </Button>
      <button className="wm:bg-primary wm:text-shadow-add-blue wm:p-2.5 wm:rounded-lg wm:shadow-md wm:shadow-blue-500/50 wm:hover:bg-primary/80 wm:active:bg-primary/90">
        Default
      </button>
    </div>
  );
}

--------------------------------------------------------

3. Use components

import { Button } from "@alsaeedfayed/ui-lib";

export default function Page() {
  return (
    <Button variant="primary" size="lg">
      Save to Cart
    </Button>
  );
}

4. Use design tokens directly

import { colors, spacing } from "@alsaeedfayed/ui-lib/design-system";

const style = { color: colors.primary.DEFAULT, padding: spacing[4] };

5. Use SCSS variables in your app

@use "@alsaeedfayed/ui-lib/src/design-system/scss/variables" as wm;
@use "@alsaeedfayed/ui-lib/src/design-system/scss/mixins" as wm-mix;

.my-component {
  color: wm.$color-primary;
  @include wm-mix.focus-ring(wm.$color-primary);
}