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

@widgetui/katon-theme

v0.4.2

Published

Widgets Theme

Readme

@widgetui/katon-theme

A modern, flexible theme for the @widgetui framework, providing consistent styling and animations for UI components.

Table of Contents

Overview

@widgetui/katon-theme is a comprehensive theme for the @widgetui framework. It provides a consistent, modern styling system for UI components, with support for customization, color variants, and animations. The theme is designed to be flexible and extensible, allowing you to create beautiful, responsive user interfaces with minimal effort.

Installation

# Using npm
npm install @widgetui/katon-theme

# Using yarn
yarn add @widgetui/katon-theme

# Using pnpm
pnpm add @widgetui/katon-theme

Core Concepts

Theme Settings

The Katon theme provides a set of default settings that define the visual appearance of UI components. These settings include:

  • Gap: Spacing between elements
  • Radius: Border radius for components
  • Border: Border width, style, and color
  • Shadow: Box shadow for components
  • Blurred: Backdrop filter blur amount

These settings are used consistently across all components to ensure a cohesive look and feel.

Color Variants

The theme supports multiple color variants for components, including:

  • Primary: Main brand color
  • Secondary: Secondary brand color
  • Error: For error states and messages
  • Success: For success states and messages
  • Warning: For warning states and messages
  • Info: For informational states and messages
  • Link: For hyperlinks
  • Text: For text content
  • White: White color variant
  • Black: Black color variant
  • Revert: Reversed color scheme

Each variant defines foreground, background, and edge (border) colors.

Component Styling

The theme provides custom styling for various UI components, including:

  • Accordion: Collapsible content panels
  • AlertDialog: Modal dialogs for alerts and confirmations
  • Select: Dropdown selection components

Each component is styled consistently with the theme settings while providing specific customizations for optimal usability.

Animations

The theme includes animations for UI components, enhancing the user experience with smooth transitions. Currently, it provides animations for:

  • Modal Entry: Animation for when a modal appears
  • Modal Exit: Animation for when a modal disappears

Basic Usage

import { KatonTheme } from '@widgetui/katon-theme';
import { ThemeProvider } from '@widgetui/core';

// Create a new instance of the Katon theme
const theme = new KatonTheme();

// Use the theme with the ThemeProvider
const app = ThemeProvider({
  theme: theme,
  children: [
    // Your application components
  ]
});

Advanced Features

Custom Component Styling

You can customize the styling of specific components while maintaining the overall theme consistency:

import { KatonTheme } from '@widgetui/katon-theme';
import { Accordion } from '@widgetui/core';

// Create a new instance of the Katon theme
const theme = new KatonTheme();

// Create an accordion with custom styling
const accordion = theme.Accordion({
  items: [
    {
      trigger: 'Section 1',
      content: 'Content for section 1'
    },
    {
      trigger: 'Section 2',
      content: 'Content for section 2'
    }
  ],
  styles: {
    widget: {
      backgroundColor: '#f5f5f5',
      borderRadius: '0.5rem'
    },
    trigger: {
      backgroundColor: '#e0e0e0',
      color: '#333333'
    }
  }
});

Color Resolvers

The theme provides color resolvers for different layer variants, allowing you to apply consistent coloring to your components:

import { KatonTheme } from '@widgetui/katon-theme';
import { LayerVariant } from '@widgetui/core';

// Create a new instance of the Katon theme
const theme = new KatonTheme();

// Get colors for a primary variant
const primaryColors = theme.coloringResolves(LayerVariant.Primary);
console.log(primaryColors); // { fore: 'white', back: 'one', edge: 'one-100' }

// Get colors for an outline variant
const outlineColors = theme.outlineColoringResolves(LayerVariant.Primary);
console.log(outlineColors); // { fore: 'one', back: null, edge: 'one' }

Animation Integration

The theme integrates with the @protorians/animetric library to provide smooth animations for components:

import { KatonTheme } from '@widgetui/katon-theme';
import { KatonModalAnimations } from '@widgetui/katon-theme/animations/modal';

// Create a new instance of the Katon theme
const theme = new KatonTheme();

// Create an alert dialog with custom animations
const alertDialog = theme.AlertDialog({
  title: 'Confirmation',
  content: 'Are you sure you want to proceed?',
  animateIn: KatonModalAnimations.entry,
  animateOut: KatonModalAnimations.exit
});

API Reference

KatonTheme

The main theme class that extends WidgetTheme from @widgetui/core.

Properties

  • name: Gets the name of the theme ('katon')
  • stylesheets: Gets the default stylesheets for the theme

Methods

  • prepareSettings(settings): Prepares the theme settings with default values
  • outlineColoringResolves(color): Resolves colors for outline variants
  • coloringResolves(color): Resolves colors for filled variants
  • Accordion(declaration): Creates an Accordion component with theme styling
  • AlertDialog(declaration): Creates an AlertDialog component with theme styling
  • Select(declaration): Creates a Select component with theme styling

KatonModalAnimations

A class that provides animations for modal components.

Properties

  • entry: Gets the animation for modal entry
  • exit: Gets the animation for modal exit

Types Reference

| Category | Type | Description | |----------|------|-------------| | Theme Types | IThemeSettings | Interface for theme settings | | | IColoringLayer | Interface for color layer definitions | | | LayerVariant | Enum for layer color variants | | Component Types | IThemeAccordionOptions | Interface for accordion options | | | ThemeAlertDialogOptions | Interface for alert dialog options | | | IThemeSelectOptions | Interface for select component options | | | IThemeSelectStyles | Interface for select component styles | | Animation Types | IAnimetricSlimOptions | Interface for animation options |

License

This project is licensed under the ISC License. See the LICENSE file for details.