
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@consensys/ui-config
Advanced tools
> ๐ง **Note**: This package is under active development. While we're working hard to make it production-ready, please be aware that APIs and features may change. We welcome your feedback and contributions as we continue to improve!
๐ง Note: This package is under active development. While we're working hard to make it production-ready, please be aware that APIs and features may change. We welcome your feedback and contributions as we continue to improve!
๐ง Unified configuration layer for the CUI ecosystem
Build consistent, type-safe applications across web and React Native with a single configuration layer that handles framework integration, theming, and build tooling.
// One configuration. Any platform. Native everywhere.
import { vitePlugin } from '@consensys/ui-config/vite';
import { nativewindPreset } from '@consensys/ui-config/nativewind';
๐ Framework Integration - Seamless setup for Vite, Expo, and React Native with optimized defaults
๐จ Theme Integration - Unified theming system that works across all platforms
๐ง Build Tooling - Comprehensive build configurations for web and native development
๐ฑ Cross-Platform - Consistent configuration patterns for web and React Native
๐ ๏ธ Type Safety - Full TypeScript support with comprehensive type definitions
๐๏ธ Workspace Support - Optimized for monorepo setups with proper module resolution
pnpm add @consensys/ui-config
The configuration system follows a three-step process to make your theme available throughout your application:
theme.config.ts
Each platform has its own way of accessing global variables:
For detailed theme configuration options, see the @consensys/ui-theme documentation.
// theme.config.ts
import { UserConfig } from '@consensys/ui-theme'
export default {
themes: {
default: {
colors: {
neutral: 'gray',
primary: 'blue',
secondary: 'violet',
error: 'red',
warning: 'amber',
success: 'green',
},
},
},
} satisfies UserConfig;
The Vite plugin provides optimized defaults for web development:
// vite.config.ts
import { defineConfig } from 'vite'
import cui from '@consensys/ui-config/vite';
import themeConfig from "./theme.config";
export default defineConfig(({ command }) => ({
plugins: [
cui(command, themeConfig),
],
}));
The plugin automatically:
import.meta.env.CUI
You can access the theme configuration in your application using:
const theme = import.meta.env.CUI;
See vite.plugin.ts for implementation details. See vite.config.ts for usage example.
The NativeWind preset combines Tailwind and React Native styling:
// tailwind.config.js
import nativewindPreset from "@consensys/ui-config/nativewind";
import themeConfig from "./theme.config";
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
'./node_modules/@consensys/ui/**/*.{js,jsx,ts,tsx}',
],
presets: [nativewindPreset(themeConfig)]
}
See nativewind.preset.ts for implementation details. See tailwind.config.js for usage example.
Expo-specific configurations for React Native development:
// app.config.js
import withCui from '@consensys/ui-config/expo';
import themeConfig from './theme.config';
module.exports = ({ config }) => {
return withCui({ config, themeConfig });
};
The Expo configuration:
global.CUI
for runtime accessYou can access the theme configuration in your application using:
const theme = global.CUI;
See expo.preset.ts for implementation details. See app.config.js for usage example.
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ['@consensys/ui-config/expo/babel'],
};
};
The babel preset automatically configures:
See babel.preset.ts for implementation details. See babel.config.js for usage example.
Metro bundler configuration for React Native:
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
const { withCuiWorkspace } = require('@consensys/ui-config/metro');
const config = getDefaultConfig(__dirname);
module.exports = withCuiWorkspace(config);
The Metro configuration:
See metro.config.ts for implementation details. See metro.config.js for usage example.
For complete examples, see:
@consensys/ui-config provides a unified configuration layer that ties together the entire CUI ecosystem:
Single Source of Truth
theme.config.ts
file configures everythingUserConfig
typeFramework Integration
Workspace Optimization
# Install dependencies
pnpm i
# Watch and build
pnpm dev
# Production build
pnpm build
We welcome contributions!
MIT
FAQs
> ๐ง **Note**: This package is under active development. While we're working hard to make it production-ready, please be aware that APIs and features may change. We welcome your feedback and contributions as we continue to improve!
We found that @consensys/ui-config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 17 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.