
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
@hennge/ui-core
Advanced tools
A collection of design tokens and utilities for developing the HENNGE One Design System.
A collection of design tokens and utilities for developing the HENNGE One Design System. This package provides powerful Tailwind CSS utilities for creating consistent and type-safe UI components.
pnpm add @hennge/ui-core
The package exports three main utilities for working with Tailwind classes:
tv is an alias of cva with integrated tailwind-merge. It allows you to define component variants with a clean, type-safe API.
import { tv } from '@hennge/ui-core';
const button = tv({
base: "px-4 py-2 rounded font-medium focus:outline-none",
variants: {
intent: {
primary: "bg-blue-500 text-white hover:bg-blue-600",
secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300"
},
size: {
sm: "text-sm",
md: "text-base",
lg: "text-lg"
}
},
defaultVariants: {
intent: "primary",
size: "md"
}
});
// Usage
const className = button({ intent: "secondary", size: "lg" });
// Returns: "px-4 py-2 rounded font-medium focus:outline-none bg-gray-200 text-gray-800 hover:bg-gray-300 text-lg"
tx is an alias of clsx with tailwind-merge integration. It allows you to conditionally combine Tailwind classes while automatically resolving conflicts.
import { tx } from '@hennge/ui-core';
// Basic concatenation
tx('text-red-500', 'bg-blue-500');
// Returns: "text-red-500 bg-blue-500"
// Conditional classes
tx('text-red-500', isActive && 'font-bold');
// Returns: "text-red-500 font-bold" if isActive is true
// Returns: "text-red-500" if isActive is false
// Conflict resolution
tx('text-red-500', 'text-blue-500');
// Returns: "text-blue-500" (last class wins)
// Objects and arrays
tx('flex', { 'p-4': true, 'hidden': isMobile }, ['rounded', 'shadow']);
// Returns combined classes with proper conflict resolution
compose allows you to combine multiple tv variant definitions for more complex components.
import { tv, compose } from '@hennge/ui-core';
const baseButton = tv({
base: "rounded-md focus:outline-none",
variants: {
size: {
sm: "py-1 px-2 text-sm",
md: "py-2 px-4 text-base",
lg: "py-3 px-6 text-lg"
}
},
defaultVariants: {
size: "md"
}
});
const coloredButton = tv({
variants: {
color: {
blue: "bg-blue-500 hover:bg-blue-600 text-white",
red: "bg-red-500 hover:bg-red-600 text-white",
green: "bg-green-500 hover:bg-green-600 text-white"
}
},
defaultVariants: {
color: "blue"
}
});
// Combine the variants
const button = compose(baseButton, coloredButton);
// Usage
const className = button({ size: "lg", color: "green" });
// Returns: "rounded-md focus:outline-none py-3 px-6 text-lg bg-green-500 hover:bg-green-600 text-white"
All utilities are fully typed, providing autocomplete and type checking for your variants:
import { tv, type VariantProps } from '@hennge/ui-core';
const button = tv({
variants: {
color: {
primary: "bg-blue-500",
secondary: "bg-gray-500"
}
}
});
type ButtonVariants = VariantProps<typeof button>;
// Inferred as: { color?: "primary" | "secondary" | undefined }
| Function | Description |
|---|---|
tv | Creates variant components with Tailwind classes |
tx | Merges Tailwind classes with automatic conflict resolution |
compose | Combines multiple variant components |
This section provides instructions on how to develop and maintain the @hennge/ui-core package.
fnm install
This uses the .nvmrc file in the project root to install and use the correct Node.js version.The package provides several pnpm scripts to assist with development, testing, and building:
pnpm devStarts the development mode with file watching enabled. This command runs tsdown --watch, which continuously compiles TypeScript files as they are modified, allowing for real-time feedback during development.
pnpm dev
pnpm buildBuilds the package for production. This script runs both tsdown to compile TypeScript code and dtsroll to generate declaration files.
pnpm build
pnpm typecheckRuns the TypeScript compiler (tsc) to check for type errors without emitting any output files.
pnpm typecheck
pnpm lintLints the codebase using Biome, ensuring code quality and consistency.
pnpm lint
pnpm dtscheckChecks TypeScript declaration files for correctness using @arethetypeswrong/cli. This is useful to verify that the package provides accurate type definitions.
pnpm dtscheck
pnpm testRuns the test suite using Vitest to verify the functionality of the package.
pnpm test
A typical development workflow might look like this:
pnpm devpnpm typecheckpnpm test to ensure functionalitypnpm lintpnpm buildpnpm dtscheckpnpm pack to verify the final package contentsApache-2.0 - see LICENSE for details.
FAQs
A collection of design tokens and utilities for developing the HENNGE One Design System.
The npm package @hennge/ui-core receives a total of 276 weekly downloads. As such, @hennge/ui-core popularity was classified as not popular.
We found that @hennge/ui-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.