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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@danhua123/ui-mobile-cockpit

v1.0.1

Published

基于 Ant Design Mobile 5 的公司内部移动端组件库,包含 Cockpit 驾驶舱组件

Readme

公司内部移动端组件库

基于 Ant Design Mobile 5 封装的公司内部移动端组件库,提供统一的 UI 风格和交互体验。现已包含 Cockpit 驾驶舱组件!

✨ 特性

  • 🎯 基于 Ant Design Mobile 5 封装,保持设计一致性
  • 📱 专为移动端优化的组件
  • 🔧 TypeScript 支持,提供完整的类型定义
  • 📚 完善的文档和示例
  • 🎨 支持主题定制
  • 📦 支持按需加载

📦 安装

npm install @danhua123/ui-mobile-cockpit
# 或
yarn add @danhua123/ui-mobile-cockpit

🔨 使用

基本使用

import { Button, Input, Card, Cockpit } from '@danhua123/ui-mobile-cockpit';
import '@danhua123/ui-mobile-cockpit/dist/style.css';

function App() {
  const footerTabs = [
    { key: 'home', title: '首页', icon: <HomeIcon />, url: '/home' },
    { key: 'profile', title: '我的', icon: <UserIcon />, url: '/profile' },
  ];

  return (
    <Cockpit
      NavBarTitle="我的应用"
      footerTabs={footerTabs}
      onNavigate={(url) => console.log('跳转到:', url)}
    >
      <div>
        <Button type="primary">主要按钮</Button>
        <Input placeholder="请输入内容" />
        <Card title="卡片标题">
          卡片内容
        </Card>
      </div>
    </Cockpit>
  );
}

按需加载

import Button from '@danhua123/ui-mobile-cockpit/lib/Button';
import Input from '@danhua123/ui-mobile-cockpit/lib/Input';
import Card from '@danhua123/ui-mobile-cockpit/lib/Card';

🔗 组件

Cockpit 驾驶舱组件 🊕

为移动端应用提供统一的页面布局和导航体验。

功能特点:

  • 🗺️ 统一的页面布局和导航栏
  • 🚀 响应式底部标签导航
  • 📋 支持二级菜单显示
  • 🎨 可自定义主题色
  • 📱 安全区域适配
  • 🔄 灵活的路由管理

Button 按钮

基于 Ant Design Mobile Button 组件封装,支持公司内部的设计规范。

Input 输入框

基于 Ant Design Mobile Input 组件封装,提供统一的输入体验。

Card 卡片

基于 Ant Design Mobile Card 组件封装,支持多种布局和样式。

🖥 本地开发

# 安装依赖
npm install

# 启动开发模式
npm run dev

# 启动演示应用
npm run demo

# 启动 Storybook
npm run storybook

# 构建组件库
npm run build

# 代码检查
npm run lint

📁 目录结构

├── src/                 # 源代码
│   ├── components/      # 组件目录
│   │   ├── Button/     # 按钮组件
│   │   ├── Input/      # 输入框组件
│   │   ├── Card/       # 卡片组件
│   │   └── Cockpit/    # 驾驶舱组件
│   └── index.ts        # 入口文件
├── demo/               # 演示应用
├── stories/            # Storybook 文档
└── dist/               # 构建产物

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 License

MIT License