@hennge/ui-react
A collection of highly accessible React components implementing the HENNGE One Design System

Features
- Fully accessible components following WAI-ARIA patterns
- Comprehensive theming support for HENNGE One products
- Responsive design and mobile-friendly components
- Built on top of React Aria Components for solid accessibility foundations
- Tailwind CSS integration (optional)
Accessibility Foundation
HENNGE UI React is strategically built on industry-leading accessibility foundations:
- React Aria Components by Adobe: Provides comprehensive ARIA patterns, keyboard navigation, and screen reader support
- Headless UI by Tailwind Labs: Offers accessible primitives with robust interaction patterns
This approach allows our library to deliver a polished visual layer atop these battle-tested accessibility implementations. By leveraging these foundations, HENNGE applications can more easily achieve WCAG 2.1 Level AA compliance.
Benefits of this architecture include:
- Simplified development: Core accessibility patterns have been thoroughly tested by the wider community
- Reduced accessibility barriers: Common accessibility issues are solved at the component level
- Consistent behavior: Interactions work predictably across different browsers and assistive technologies
- Faster compliance: Projects using this library inherit accessibility best practices automatically
Installation
pnpm add @hennge/ui-react
Usage
Basic Setup
Import the CSS in your application entry point:
import "@hennge/ui-react/css";
Although this stylesheet is produced using Tailwind CSS, you DO NOT need Tailwind CSS in your project to use this library.
Using Components
import { Button } from "@hennge/ui-react";
function MyComponent() {
return (
<Button intent="primary" size="medium">
Click Me
</Button>
);
}
Tailwind CSS Integration
Project Setup with Tailwind CSS V4
For projects using Tailwind CSS V4, you can integrate HENNGE UI React's styles:
pnpm add -D tailwindcss-react-aria-components
@import "tailwindcss";
@import "@hennge/ui-react/tailwindcss";
@source "../node_modules/@hennge/ui-react";
@source
directive compiles HENNGE UI React with your project's Tailwind CSS for optimal bundle size.
Modular Setup with Tailwind CSS V4
For more granular control, you can selectively import specific theme components:
@import "tailwindcss";
@import "@hennge/ui-react/tailwindcss/unset-colors.css";
@import "@hennge/ui-react/tailwindcss/theme-hennge-default.css";
@import "@hennge/ui-react/tailwindcss/theme-hennge-identity.css";
@import "@hennge/ui-react/tailwindcss/theme-hennge-dlp.css";
@import "@hennge/ui-react/tailwindcss/theme-hennge-cybersecurity.css";
@import "@hennge/ui-react/tailwindcss/utilities.css";
@plugin "tailwindcss-react-aria-components";
@source "../node_modules/@hennge/ui-react";
Font Setup
HENNGE UI React requires the following font packages for proper display:
pnpm add @fontsource-variable/noto-sans-jp @fontsource-variable/noto-sans-mono
Import the fonts in your application entry point:
import "@fontsource-variable/noto-sans-jp";
import "@fontsource-variable/noto-sans-mono";
Optional Chinese Language Support
For applications requiring Chinese language support:
pnpm add @fontsource-variable/noto-sans-tc
pnpm add @fontsource-variable/noto-sans-sc
And import in your application:
import "@fontsource-variable/noto-sans-tc";
import "@fontsource-variable/noto-sans-sc";
Documentation
Complete documentation of all components is available in Storybook:
- Online Storybook (requires HENNGE organization account)
- Local development Storybook (see Development section)
Development
Prerequisites
- Node.js - Install the correct version using fnm:
fnm install
This uses the .nvmrc
file in the project root.
- pnpm (used by the team for package management)
Available Scripts
pnpm build
Builds the package for production, including JavaScript, CSS, and themes.
pnpm build
pnpm dev
Starts the development mode with file watching enabled.
pnpm dev
pnpm typecheck
Runs TypeScript's type checking to ensure there are no type errors.
pnpm typecheck
pnpm lint
Lints the codebase using Biome.
pnpm lint
pnpm test
Runs the test suite using Vitest.
pnpm test
pnpm icons
Compiles SVG files from the /svg
folder into React components. This script automates the SVG-to-React conversion process, ensuring consistent and optimized icon components.
pnpm icons
Icon Workflow
The SVG icon workflow follows these steps:
-
SVG files are organized in the /svg
directory with specific naming conventions:
- Files should be placed in subdirectories that indicate their category (e.g.,
/icon
, /fileIcon
)
- The subdirectory name becomes part of the component name
- For example:
/fileIcon/csv.svg
will be compiled to /src/FileIconCsv.tsx
/icon/account.svg
will be compiled to /src/IconAccount.tsx
-
The compiler:
- Transforms SVG files into React components
- Applies proper naming conventions using PascalCase
- Sets default props like size, color, and accessibility attributes
- Optimizes the SVG code for React
-
Importing generated icons:
import { IconAccount } from "@hennge/ui-react";
function App() {
return <IconAccount />;
}
Adding New Icons
New icons should be sourced from the HENNGE Design System Figma file:
- Go to the Design System Figma file
- Navigate to the Icons section
- Select the icons you need (be careful not to select text labels)
- Export as SVG format from the Export panel
- Place the exported files in the appropriate subdirectory under
/svg
- Run
pnpm icons
to generate the React components
pnpm themes
Converts color themes from hexadecimal format to P3 color space using OKLCH syntax. This script enhances color rendering on modern displays while maintaining backward compatibility.
pnpm themes
Theme Workflow
The theme workflow involves:
-
Theme source files are stored in /src/themes-hex/
directory in standard hexadecimal format:
theme-hennge-default.css
theme-hennge-identity.css
theme-hennge-dlp.css
theme-hennge-cybersecurity.css
-
The compiler:
- Reads these source files
- Converts the hexadecimal colors to OKLCH color space with high precision (5 significant digits)
- Outputs the processed files to
/src/themes/
directory
- Preserves color fidelity while enabling better rendering on wide-gamut displays
-
Finally, during the build process:
- Theme files are copied to the distribution package
- Made available through various import paths for consumer applications
This process is typically only needed when updating the design system colors or adding new themes. Most developers won't need to run this script regularly.
Development Workflow
A typical development workflow for this package might look like this:
-
Start the development mode with file watching enabled:
pnpm dev
-
Make changes to the source code in the /src
directory
-
Verify type correctness:
pnpm typecheck
-
Run tests to ensure functionality:
pnpm test
-
Lint your code to ensure consistency:
pnpm lint
-
Build the package for production:
pnpm build
-
Create a tarball for testing with:
pnpm pack
This generates a .tgz
file that can be installed in other projects to verify the package works correctly.
Testing the Package in Other Projects
When testing in a monorepo setup, there are additional considerations for handling internal dependencies like @hennge/ui-core
. Yalc provides an excellent solution for this scenario.
Using Yalc for Local Package Testing
Yalc acts as a local package repository, making it easy to share local packages across projects without publishing to a registry. It's especially useful for testing packages with internal dependencies like our monorepo structure.
-
Installation:
pnpm add -g yalc
-
Publishing and using packages:
pnpm build
yalc publish
yalc add @hennge/ui-core
pnpm install
pnpm build
yalc publish
yalc add @hennge/ui-react
pnpm install
-
Updating packages during development:
pnpm build
yalc push
pnpm build
yalc push
-
Removing yalc dependencies when done:
yalc remove --all
pnpm install
This workflow allows you to test your changes in a real application context without publishing to npm or dealing with complex manual extractions.
License
Apache-2.0 - see LICENSE for details.