@calimero-network/mero-ui

中文文档
1.5.2发布于 2026/10/03TypeScriptESM + CJS构建来源已验证近 30 天下载 8510

UI primitives for Calimero design system

原始使用文档
文档目录27 节
  1. Installation
  2. Quick Start
  3. 1. Import CSS Variables
  4. 2. Import and use components
  5. Available Components
  6. Layout & Structure
  7. Navigation
  8. Forms & Input
  9. Data Display
  10. Feedback & Status
  11. Media & Content
  12. Typography
  13. Utility
  14. Design Tokens
  15. Colors
  16. Spacing
  17. Typography
  18. Border Radius
  19. CSS Variables
  20. Available CSS Variables
  21. Theming
  22. TypeScript Support
  23. Accessibility
  24. Browser Support
  25. Contributing
  26. License
  27. Changelog

@calimero-network/mero-ui

A comprehensive React UI component library built for the Calimero design system. This package provides a complete set of accessible, customizable components with built-in dark theme support.

Installation

npm install @calimero-network/mero-ui
# or
yarn add @calimero-network/mero-ui
# or
pnpm add @calimero-network/mero-ui

Quick Start

1. Import CSS Variables

Important: You must import the CSS variables for proper styling. Choose one of the following methods:

Option A: Import CSS file directly

/* In your main CSS file */
@import "@calimero-network/mero-ui/styles.css";

Option B: Import in HTML

<link
  rel="stylesheet"
  href="node_modules/@calimero-network/mero-ui/dist/styles.css"
/>

Option C: Programmatic injection

import { cssVariables } from "@calimero-network/mero-ui";

// Inject CSS variables into your document
const style = document.createElement("style");
style.textContent = cssVariables;
document.head.appendChild(style);

2. Import and use components

import React from "react";
import { Button, Card, Text, Input } from "@calimero-network/mero-ui";

function App() {
  return (
    <div>
      <Card>
        <Text size="lg" weight="bold">
          Welcome to Calimero UI
        </Text>
        <Input placeholder="Enter your name" />
        <Button variant="primary">Get Started</Button>
      </Card>
    </div>
  );
}

export default App;

Available Components

Layout & Structure

  • Box - Flexible container component
  • Flex - Flexbox container
  • Stack - Vertical/horizontal stack layout
  • Grid & GridItem - CSS Grid layout system
  • Center - Center content horizontally and vertically
  • Spacer - Add spacing between elements
  • Layout - Main layout wrapper
  • Container - Responsive container
  • AuthLayout - Authentication page layout

Navigation

  • Navbar - Top navigation bar
  • Sidebar - Side navigation panel
  • Breadcrumbs - Navigation breadcrumbs
  • Menu - Dropdown and context menus
  • Tabs - Tab navigation
  • Accordion - Collapsible content sections
  • CommandPalette - Command search interface

Forms & Input

  • Input - Text input field
  • Textarea - Multi-line text input
  • NumberInput - Numeric input with controls
  • Select - Dropdown selection
  • Checkbox - Checkbox input
  • Radio & RadioGroup - Radio button inputs
  • Switch - Toggle switch
  • DatePicker - Date selection
  • TimePicker - Time selection
  • FileUpload - File upload component
  • SearchInput - Search input with suggestions
  • TagInput - Tag input with autocomplete
  • RichTextEditor - Rich text editing with Tiptap
  • Form - Form wrapper with validation
  • BuildWizard - Multi-step form wizard

Data Display

  • Table - Data tables with sorting and filtering
  • DataTable - Advanced data table
  • EditableTable - Editable data table
  • TreeTable - Hierarchical data table
  • List - List display component
  • Tree - Tree view component
  • Calendar - Calendar component
  • Timeline - Timeline display
  • StatCard - Statistics display card
  • MetricCard - Metrics with charts
  • TrendIndicator - Trend visualization
  • EmptyState - Empty state displays
  • Skeleton - Loading placeholders

Feedback & Status

  • Alert - Alert messages
  • Banner - Banner notifications
  • Toast - Toast notifications
  • NotificationCenter - Notification management
  • Badge - Status badges
  • Progress - Progress indicators
  • Loader - Loading spinners
  • Spinner - Loading spinner
  • Modal - Modal dialogs
  • Popover - Popover content
  • Tooltip - Tooltip overlays

Media & Content

  • Avatar - User avatar display
  • Image - Image component
  • Icon - Icon component
  • Divider - Visual separators
  • FilePreview - File preview component

Typography

  • Text - Text component with variants
  • Heading - Heading components
  • Code - Code display
  • Link - Link component

Utility

  • Tag - Tag component
  • CopyToClipboard - Copy to clipboard utility
  • SearchHighlight - Search result highlighting

Design Tokens

The package includes comprehensive design tokens for consistent styling:

Colors

import { colors } from "@calimero-network/mero-ui";

// Brand colors
colors.brand[600]; // Primary brand color
colors.brand[700]; // Darker brand color

// Neutral colors
colors.neutral[200]; // Light gray
colors.neutral[800]; // Dark gray

// Semantic colors
colors.semantic.success; // Success green
colors.semantic.error; // Error red
colors.semantic.warning; // Warning orange
colors.semantic.info; // Info blue

// Background colors
colors.background.primary; // Primary background
colors.background.secondary; // Secondary background

Spacing

import { spacing } from "@calimero-network/mero-ui";

spacing[2]; // 0.5rem
spacing[4]; // 1rem
spacing[6]; // 1.5rem

Typography

import { fonts } from "@calimero-network/mero-ui";

fonts.body; // Main body font
fonts.heading; // Heading font
fonts.secondary; // Secondary font

Border Radius

import { radius } from "@calimero-network/mero-ui";

radius.sm; // 8px
radius.md; // 12px
radius.lg; // 16px

CSS Variables

All design tokens are available as CSS variables:

.my-component {
  background-color: var(--color-background-primary);
  color: var(--color-neutral-200);
  font-family: var(--font-body);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--color-neutral-600);
}

Available CSS Variables

Colors

  • --color-neutral-200 to --color-neutral-900
  • --color-brand-100, --color-brand-600 to --color-brand-900
  • --color-background-primary, --color-background-secondary, --color-background-tertiary
  • --color-semantic-success, --color-semantic-warning, --color-semantic-error, --color-semantic-info

Spacing

  • --space-2, --space-3, --space-4, --space-6

Border Radius

  • --radius-sm, --radius-md, --radius-lg

Fonts

  • --font-body, --font-heading, --font-secondary

Theming

The design system is built with a dark theme as the default. All components automatically use the appropriate colors and styling for the dark theme. The CSS variables ensure consistent theming across all components.

TypeScript Support

Full TypeScript support is included with comprehensive type definitions for all components and their props.

import { Button, ButtonProps } from '@calimero-network/mero-ui';

const MyButton: React.FC<ButtonProps> = ({ variant, children, ...props }) => {
  return <Button variant={variant} {...props}>{children}</Button>;
};

Accessibility

All components are built with accessibility in mind, including:

  • Proper ARIA attributes
  • Keyboard navigation support
  • Screen reader compatibility
  • Focus management
  • Color contrast compliance

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

This package is part of the Calimero design system. For contributing guidelines and development setup, please refer to the main design system repository.

License

This package is part of the Calimero project. Please refer to the main project for licensing information.

Changelog

See CHANGELOG.md for a detailed list of changes and updates.

版本与发布记录

@calimero-network/mero-ui 共发布 19 个版本,首次发布于 2025/08/29;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.5.2latest2026/10/031 个月前
1.5.12026/08/212 个月前
1.5.02025/10/311 年前
1.4.02025/10/131.1 年前
1.3.02025/10/061.1 年前
1.2.02025/10/061.1 年前

关于 @calimero-network/mero-ui 的常见问题

@calimero-network/mero-ui 是什么?

UI primitives for Calimero design system

如何安装 @calimero-network/mero-ui?

在项目目录运行 npm install @calimero-network/mero-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=19.0.0)、react-dom(>=19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@calimero-network/mero-ui 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@calimero-network/mero-ui 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@calimero-network/mero-ui 可以商用吗?

@calimero-network/mero-ui 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@calimero-network/mero-ui 的下载量有多少?

根据 npm 官方下载统计,@calimero-network/mero-ui 在 2026/10/09 – 2026/11/07 这 30 天内被下载 8,510 次,日均约 284 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@calimero-network/mero-ui 还在维护吗?

最新版本 1.5.2 发布于 2026/10/03(1 个月前);至今共发布 19 个版本,其中过去 12 个月发布了 2 个;首次发布于 2025/08/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。