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

@xanui/core

v1.2.53

Published

Xanui Core Library

Readme

Xanui Core

Xanui Core is a lightweight styling and theming toolkit for React. It bundles a constraint-based CSS generator, a TypeScript-friendly <Tag> primitive, responsive helpers, and an opinionated theme engine so that design tokens, animations, and layout logic stay consistent across your application.

Highlights

  • Build any element with <Tag> and the ergonomic sx/alias props while still passing native attributes.
  • Author design tokens once via createTheme, ship them with ThemeProvider, and switch them at runtime with createThemeSwitcher.
  • Drive responsive layouts using BreakpointProvider, useBreakpoint, and useBreakpointProps without bespoke media queries.
  • Compose micro-animations through useAnimation, ready-made Transition variants, and reusable CSS utilities.
  • Support SSR portals by rehydrating critical styles with RenderServerStyles.

Installation

npm install @xanui/core

Quick Start

import { ThemeProvider, Tag, createTheme, createThemeSwitcher } from '@xanui/core'

// Register a custom theme once at startup
createTheme('brand', {
	colors: {
		brand: { primary: '#7C3AED', secondary: '#5B21B6' },
	},
})

const useThemeSwitcher = createThemeSwitcher('brand', ThemeSwitcherOption)

export const App = () => {
	const { name, change } = useThemeSwitcher()

	return (
		<ThemeProvider theme={name} isRootProvider>
			<Tag
				component="main"
				px={24}
				py={32}
				bgcolor="background"
				color="text.primary"
				gap={24}
			>
				<Tag component="h1" fontSize="h2">
					Xanui Core
				</Tag>

				<button onClick={() => change(name === 'brand' ? 'dark' : 'brand')}>
					Toggle Theme
				</button>
			</Tag>
		</ThemeProvider>
	)
}

Core Concepts

  • Design TokenscreateTheme merges your overrides with defaults and exposes typed references like brand.primary or typography presets.
  • Adaptive Layout – Wrap your app with BreakpointProvider (automatically included by ThemeProvider when isRootProvider is true) to consume breakpoint helpers throughout the tree.
  • Composable Stylescss, getValue, and getProps transform alias props, breakpoints, and pseudo selectors into atomic class names. Use them directly for utilities such as scrollbars or keyframes.
  • Animation PrimitivesuseAnimation builds scoped keyframes on the fly; Transition controls mount/unmount sequences with variants such as fade, slideDown, or collapseVertical.

Server-Side Rendering

When rendering on the server, collect the emitted styles:

import RenderServerStyles from '@xanui/core/RenderServerStyles'

export const Document = () => (
	<html>
		<head>
			<RenderServerStyles />
		</head>
		<body>{/* app */}</body>
	</html>
)

Documentation

Detailed API docs (props tables, option summaries, and usage examples) live inside the docs/ directory. Each API/component has its own README.md for fast reference:

  • docs/tag/README.md
  • docs/theme-provider/README.md
  • docs/transition/README.md
  • docs/use-animation/README.md
  • docs/use-color-template/README.md
  • docs/use-interface/README.md
  • docs/use-breakpoint/README.md
  • docs/use-breakpoint-props/README.md
  • docs/use-scrollbar/README.md
  • docs/render-server-styles/README.md
  • docs/css/README.md
  • docs/create-theme/README.md

Contributing

  1. Fork and clone the repo.
  2. Run npm install.
  3. Use npm run build to verify type safety.
  4. Submit a pull request that focuses on one improvement at a time.

Need another integration example or a new preset? Open an issue so we can keep the primitives lean and discoverable.