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

kratos-ui

v1.4.5

Published

A flexible UI library with theming and CSS specificity hierarchy. Supports React 16.11+ through React 19+ with full backward and forward compatibility.

Readme

Kratos UI

GMP personal UI component library 💪💪

⚠️ React Compatibility

This library requires React 16.8.0 or higher due to the use of React Hooks. The library uses the following React features:

  • React Hooks: useState, useEffect, useRef, useMemo, useContext
  • Forward Ref: forwardRef (requires React 16.3+)
  • Context API: createContext (requires React 16.3+)

Version Support

  • React 16.8.0+: ✅ Fully supported
  • React 16.3.0 - 16.7.x: ⚠️ Partial support (Context API works, but no Hooks)
  • React < 16.3.0: ❌ Not supported

🎯 Key Features

  • Storybook Documentation - Interactive examples and documentation
  • Emotion Integration - Pure CSS-in-JS with @emotion/css
  • Theme Integration - Style all components once using theme
  • makeStyles Hook - Dynamic styling with theme and props
  • CSS Specificity Hierarchy - Theme → makeStyles → Inline → !important

📦 Installation

npm install kratos-ui

⚙️ Setup

Step 1: Initialize Emotion (Optional)

Optional but Recommended: For better control over CSS class names, you can initialize emotion with a custom key. The library will auto-initialize with the default key 'kratos' if you don't call this.

import { initEmotion } from 'kratos-ui';

// Initialize emotion with a custom key (optional)
// Use your project name or any unique identifier
initEmotion('my-project-name');

Note: If you don't call initEmotion, the library will automatically initialize with the key 'kratos'. This ensures the library works out-of-the-box without any setup.

Step 2: Wrap Your App with ThemeProvider (Optional but Recommended)

import { ThemeProvider, createTheme } from 'kratos-ui';

const theme = createTheme({
    palette: {
        primary: { main: '#1976d2' },
    },
});

function App() {
    return (
        <ThemeProvider theme={theme}>
            {/* Your app components */}
        </ThemeProvider>
    );
}

🚀 Quick Start

Basic Usage

import React from 'react';
import { Button, ThemeProvider, createTheme, initEmotion } from 'kratos-ui';

// ⚠️ IMPORTANT: Initialize emotion before using any components
// This must be called once at the root of your application
initEmotion('kratos'); // Use 'kratos' or any unique key for your project

// Create a custom theme
const theme = createTheme({
    palette: {
        primary: { main: '#1976d2' },
        secondary: { main: '#dc004e' },
    },
});

function App() {
    return (
        <ThemeProvider theme={theme}>
            <Button variant="contained" color="primary">
                Click me
            </Button>
        </ThemeProvider>
    );
}

⚠️ Emotion Initialization (Optional)

Optional: The library auto-initializes emotion with the default key 'kratos', so you can start using components immediately without any setup.

If you want to use a custom key for CSS class names (to avoid conflicts with other emotion instances), you can call initEmotion(key):

import { initEmotion } from 'kratos-ui';

// Initialize with a custom key (optional)
initEmotion('my-project-name');

Why use a custom key? If your project uses multiple emotion instances, using a custom key ensures CSS class names are properly scoped and don't conflict.

🎨 makeStyle hook

import { Button, makeStyles } from 'kratos-ui';

const useStyles = makeStyles({
    customButton: {
        backgroundColor: 'orange',
        color: 'white',
        borderRadius: '8px',
        padding: '10px 20px',
        fontSize: '14px',
        fontWeight: '600',
    },
});

function App() {
    const classes = useStyles();

    return <Button className={classes.customButton}>Custom Styled Button</Button>;
}

🎯 CSS Specificity Hierarchy

The component follows this CSS specificity order (from lowest to highest priority):

  1. Theme styles (lowest priority)
  2. makeStyles classes (medium priority)
  3. Inline styles (high priority)
  4. !important classes (highest priority)

📚 Storybook

View all components and examples in Storybook:

Available stories:

  • Controller - Interactive components with controls
  • Variants - All components variants (showcase)
  • playground - for developing in local

🛠️ Development


1. Fork the repository - git clone
2. checkout a feature branch
3. take pull from develop branch
4. npm install --legacy-peer-deps
5. npm run start
6. Make your changes (check GUIDELINES.md file)
7. Submit a pull request to develop branch