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 🙏

© 2026 – Pkg Stats / Ryan Hefner

adm-components

v1.0.33

Published

antd design mobile enhanced components

Downloads

48

Readme

adm-components

NPM version NPM downloads

antd design mobile enhanced components

Usage

文本输入框

示例

import { IFormText } from 'adm-components';
import { Form } from 'antd-mobile';

export default () => {
  return (
    <Form>
      <IFormText name="name" label="姓名" />
    </Form>
  );
};

文本域

示例

import { IFormTextarea } from 'adm-components';
import { Form } from 'antd-mobile';
export default () => {
  return (
    <Form>
      <IFormTextarea name="desc" label="描述" 
        fieldProps={{
          maxLength: 200,
          placeholder: '请输入描述信息',
        }}
      />
    </Form>
  );
};

单选框

示例

import { IFormRadio } from 'adm-components';
import { Form } from 'antd-mobile';

export default () => {
  const options = [
    { label: '男', value: '1' },
    { label: '女', value: '2' },
  ];

  return (
    <Form>
      <IFormRadio name="sex" label="性别" vertical options={options} />
    </Form>
  );
};

异步加载数据

import { IFormRadio } from 'adm-components';
import { Form } from 'antd-mobile';

export default () => {
  const options = [
    { label: '男', value: '1' },
    { label: '女', value: '2' },
  ];

  const request = async () => {
    // 模拟请求
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          errcode: '0',
          errmsg: 'success',
          data: options,
        });
      }, 1000);
    });
  };

  return (
    <Form>
      <IFormRadio
        name="sex"
        label="性别"
        vertical
        options={[]}
        request={request}
      />
    </Form>
  );
};

参数说明:其他参数同 Form.Item 的参数 | 参数 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | | request | 异步加载数据 | () => Promise<{data: { label: string, value: string }[]}> | - | | vertical | 垂直方向 | boolean | false |

复选框

示例

import { IFormCheckbox } from 'adm-components';
import { Form } from 'antd-mobile';

export default () => {
  const options = [
    { label: '周一', value: '1' },
    { label: '周二', value: '2' },
    { label: '周三', value: '3' },
    { label: '周四', value: '4' },
    { label: '周五', value: '5' },
    { label: '周六', value: '6' },
    { label: '周日', value: '7' },
  ];

  return (
    <Form>
      <IFormCheckbox name="weekday" label="星期" vertical options={options} />
      <Form.Subscribe to={['weekday']}>
        {({ weekday }) => {
          if (!weekday) {
            return null;
          }
          console.log(weekday);
          return <Form.Item label="已选择">{JSON.stringify(weekday)}</Form.Item>;
        }}
      </Form.Subscribe>
    </Form>
  );
};

返回参数为字符串

import { IFormCheckbox } from 'adm-components';
import { Form } from 'antd-mobile';

export default () => {
  const options = [
    { label: '周一', value: '1' },
    { label: '周二', value: '2' },
    { label: '周三', value: '3' },
    { label: '周四', value: '4' },
    { label: '周五', value: '5' },
    { label: '周六', value: '6' },
    { label: '周日', value: '7' },
  ];

  return (
    <Form initialValues={{"weekday":"1,2,3"}}>
      <IFormCheckbox name="weekday" label="星期" vertical options={options}  valueType="string"/>
      <Form.Subscribe to={['weekday']}>
        {({ weekday }) => {
          if (!weekday) {
            return null;
          }
          return <Form.Item label="已选择">{weekday}</Form.Item>;
        }}
      </Form.Subscribe>
    </Form>
  );
};

异步加载数据

import { IFormCheckbox } from 'adm-components';
import { Form } from 'antd-mobile';

export default () => {
  const options = [
    { label: '周一', value: '1' },
    { label: '周二', value: '2' },
    { label: '周三', value: '3' },
    { label: '周四', value: '4' },
    { label: '周五', value: '5' },
    { label: '周六', value: '6' },
    { label: '周日', value: '7' },
  ];

  const request = async () => {
    // 模拟请求
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          errcode: '0',
          errmsg: 'success',
          data: options,
        });
      }, 1000);
    });
  };


  return (
    <Form>
      <IFormCheckbox name="weekday" label="星期" vertical request={request}  valueType="string"/>
      <Form.Subscribe to={['weekday']}>
        {({ weekday }) => {
          if (!weekday) {
            return null;
          }
          return <Form.Item label="已选择">{weekday}</Form.Item>;
        }}
      </Form.Subscribe>
    </Form>
  );
};

参数说明:其他参数同 Form.Item 的参数 | 参数 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | | request | 异步加载数据 | () => Promise<{data: { label: string, value: string }[]}> | - | | vertical | 垂直方向 | boolean | false |

日期选择器

示例

import { IFormDatePicker } from 'adm-components';
import { Form, Button, Toast } from 'antd-mobile';

export default () => {
  return (
    <Form>
      <IFormDatePicker name="birth" label="生日" />
      <Form.Subscribe to={['birth']}>
        {({ birth }) => {
          if (!birth) {
            return null;
          }
          return <Form.Item label="已选择">{birth}</Form.Item>;
        }}
      </Form.Subscribe>
    </Form>
  );
};

日期时间选择器

示例

import { IFormDateTimePicker } from 'adm-components';
import { Form, Button, Toast } from 'antd-mobile';

export default () => {
  return (
    <Form>
      <IFormDateTimePicker name="birth" label="放假时间" />
      <Form.Subscribe to={['holiday']}>
        {({ holiday }) => {
          if (!holiday) {
            return null;
          }
          return <Form.Item label="已选择">{holiday}</Form.Item>;
        }}
      </Form.Subscribe>
    </Form>
  );
};

评分

示例

import { IFormRate } from 'adm-components';
import { Form, Button, Toast } from 'antd-mobile';

export default () => {
  return (
    <Form>
      <IFormRate name="score" label="评分" />
      <Form.Subscribe to={['score']}>
        {({ score }) => {
          if (!score) {
            return null;
          }
          return <Form.Item label="已选择">{score}</Form.Item>;
        }}
      </Form.Subscribe>
    </Form>
  );
};

LICENSE

MIT