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

@folksam/ui-components

v0.8.1

Published

A comprehensive, production-ready React component library built with TypeScript and Pigment CSS. This library provides a complete set of accessible, customizable, and performant UI components following modern design system principles.

Readme

@folksam/ui-components

A comprehensive, production-ready React component library built with TypeScript and Pigment CSS. This library provides a complete set of accessible, customizable, and performant UI components following modern design system principles.

Features

Modern Stack: Built with TypeScript, React 19+, and Pigment CSS for zero-runtime CSS-in-JS
🎨 Design System Integration: Seamlessly integrates with @folksam/ui-design-tokens
🎯 Type Safe: Full TypeScript support with comprehensive prop typing
Performance Optimized: Tree-shakeable exports and minimal bundle impact
📚 Comprehensive Documentation: Extensive examples and API documentation

Installation

# Using npm
npm install @folksam/ui-components @folksam/ui-design-tokens @folksam/ui-styles

# Using pnpm
pnpm add @folksam/ui-components @folksam/ui-design-tokens @folksam/ui-styles

# Using yarn
yarn add @folksam/ui-components @folksam/ui-design-tokens @folksam/ui-styles

Quick Start

import { UiButton, UiForm, UiFormInput, UiModal } from '@folksam/ui-components';
import { globalCssBaseline } from '@folksam/ui-styles';
import '@folksam/ui-design-tokens/css/theme.css';

// This adds font styles and a very aggressive reset
globalCssBaseline();

function App() {
  return (
    <div>
      <UiButton uiVariant="primary" onClick={() => alert('Hello!')}>
        Click me
      </UiButton>

      <UiForm>
        <UiFormInput
          uiLabel="Email address"
          type="email"
          placeholder="Enter your email"
          required
        />
      </UiForm>
    </div>
  );
}

Architecture & Design Principles

Naming Convention

All components follow a consistent naming pattern: Ui{Category!}{Name?}{Specifier?}

// Category-based naming
UiFormInput; // Form category, Input component
UiFormInputRadio; // Form category, Input component, Radio specifier
UiNavigationTabs; // Navigation category, Tabs component
UiTypographyHeading; // Typography category, Heading component

// Exception: When category equals name
UiForm; // Not UiFormForm
UiModal; // Not UiModalModal

Benefits:

  • 🔍 Excellent IntelliSense: Type Ui and get categorized autocompletion
  • 📁 Clear Organization: Components grouped by category in file structure
  • 🎯 Predictable API: Easy to guess component names based on usage
  • 🚫 No Conflicts: Unique naming prevents conflicts with other libraries

Prop Naming Convention

All custom props are prefixed with ui to distinguish them from native HTML attributes:

<UiButton
  uiVariant="primary" // Our custom variant prop
  uiSize="large" // Our custom size prop
  type="submit" // Native HTML attribute
  disabled // Native HTML attribute
  className="custom-class" // Standard React prop
>
  Submit Form
</UiButton>

Benefits:

  • Clear Separation: Instantly identify custom vs. native props
  • 📚 Better Documentation: API docs clearly show component-specific features
  • 🔧 Easier Maintenance: Refactor custom props without affecting native behavior
  • 🎯 Enhanced Developer Experience: Autocomplete groups related props together

TypeScript Integration

Full TypeScript support with comprehensive type definitions:

import type { UiButtonProps } from '@folksam/ui-components';

// Strict typing for component props
function MyButton(props: UiButtonProps) {
  return <UiButton {...props}>{children}</UiButton>;
}

// Union types for controlled APIs
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost';
type ButtonSize = 'small' | 'medium' | 'large';

Accessibility Standards

  • WCAG 2.1 AA Compliant: All components is actively worked on to meet accessibility guidelines and regulations
  • ⌨️ Keyboard Navigation: Full keyboard support with proper focus management
  • 🔊 Screen Reader Support: ARIA labels, descriptions, and live regions
  • 🎯 Focus Management: Logical tab order and focus trapping in modals
  • 🏷️ Semantic HTML: Proper HTML structure and landmark usage
// Accessibility built-in
<UiFormInput
  uiLabel="Password"
  type="password"
  uiDescription="Must be at least 8 characters"
  uiErrorMessage="Password is too short"
  required
  aria-describedby="password-help"
/>

Advanced Usage

Theming & Customization

Components automatically inherit from your design token system:

import { css } from '@pigment-css/react';
import { theme } from '@folksam/ui-design-tokens';

// Custom styling with design tokens
const customButton = css({
  backgroundColor: theme.button_primary_surface,
  borderRadius: theme.radius_l,
  padding: `${theme.spacing_m} ${theme.spacing_l}`,
  '&:hover': {
    backgroundColor: theme.button_primary_surface_hover,
  },
});

<UiButton className={customButton}>Custom Styled Button</UiButton>;

Related Packages


Built with ❤️ by the Folksam Design System Team