JSPM

antd-mobile

1.0.0-alpha.9
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 44688
  • Score
    100M100P100Q140008F
  • License MIT

基于 React 的移动设计规范实现

Package Exports

  • antd-mobile/dist/antd-mobile.css
  • antd-mobile/dist/antd-mobile.less
  • antd-mobile/lib/accordion/index.web
  • antd-mobile/lib/accordion/style/css.web
  • antd-mobile/lib/action-sheet
  • antd-mobile/lib/action-sheet/index
  • antd-mobile/lib/action-sheet/index.web
  • antd-mobile/lib/action-sheet/style
  • antd-mobile/lib/action-sheet/style/index
  • antd-mobile/lib/activity-indicator
  • antd-mobile/lib/activity-indicator/index
  • antd-mobile/lib/activity-indicator/index.web
  • antd-mobile/lib/activity-indicator/style
  • antd-mobile/lib/activity-indicator/style/index
  • antd-mobile/lib/badge
  • antd-mobile/lib/badge/index
  • antd-mobile/lib/badge/index.web
  • antd-mobile/lib/badge/style
  • antd-mobile/lib/badge/style/index
  • antd-mobile/lib/button
  • antd-mobile/lib/button/index
  • antd-mobile/lib/button/index.web
  • antd-mobile/lib/button/style/css.web
  • antd-mobile/lib/card
  • antd-mobile/lib/card/index
  • antd-mobile/lib/card/index.web
  • antd-mobile/lib/card/style
  • antd-mobile/lib/card/style/index
  • antd-mobile/lib/carousel
  • antd-mobile/lib/carousel/index
  • antd-mobile/lib/carousel/index.web
  • antd-mobile/lib/carousel/style
  • antd-mobile/lib/carousel/style/index
  • antd-mobile/lib/carousel/style/index.js
  • antd-mobile/lib/checkbox
  • antd-mobile/lib/checkbox/AgreeItem
  • antd-mobile/lib/checkbox/CheckboxItem
  • antd-mobile/lib/checkbox/index
  • antd-mobile/lib/checkbox/index.web
  • antd-mobile/lib/checkbox/style
  • antd-mobile/lib/checkbox/style/index
  • antd-mobile/lib/date-picker
  • antd-mobile/lib/date-picker/index
  • antd-mobile/lib/date-picker/index.web
  • antd-mobile/lib/date-picker/locale/en_US
  • antd-mobile/lib/date-picker/locale/zh_CN
  • antd-mobile/lib/date-picker/style/css.web
  • antd-mobile/lib/drawer
  • antd-mobile/lib/drawer/index
  • antd-mobile/lib/drawer/index.web
  • antd-mobile/lib/flex
  • antd-mobile/lib/flex/index
  • antd-mobile/lib/flex/index.web
  • antd-mobile/lib/grid
  • antd-mobile/lib/grid/index
  • antd-mobile/lib/grid/index.web
  • antd-mobile/lib/grid/style
  • antd-mobile/lib/grid/style/index
  • antd-mobile/lib/icon
  • antd-mobile/lib/icon/index
  • antd-mobile/lib/icon/index.web
  • antd-mobile/lib/icon/style/css.web
  • antd-mobile/lib/image-picker
  • antd-mobile/lib/image-picker/index
  • antd-mobile/lib/image-picker/index.web
  • antd-mobile/lib/image-picker/style
  • antd-mobile/lib/image-picker/style/index
  • antd-mobile/lib/input-item
  • antd-mobile/lib/input-item/index
  • antd-mobile/lib/input-item/index.web
  • antd-mobile/lib/input-item/style
  • antd-mobile/lib/input-item/style/index
  • antd-mobile/lib/list
  • antd-mobile/lib/list-view
  • antd-mobile/lib/list-view/index.web
  • antd-mobile/lib/list-view/style/css.web
  • antd-mobile/lib/list/ListItem
  • antd-mobile/lib/list/ListItem.web
  • antd-mobile/lib/list/index
  • antd-mobile/lib/list/index.web
  • antd-mobile/lib/list/style
  • antd-mobile/lib/list/style/css.web
  • antd-mobile/lib/list/style/index
  • antd-mobile/lib/list/style/index.css
  • antd-mobile/lib/menu
  • antd-mobile/lib/menu/index
  • antd-mobile/lib/menu/index.web
  • antd-mobile/lib/modal
  • antd-mobile/lib/modal/index
  • antd-mobile/lib/modal/index.web
  • antd-mobile/lib/modal/style
  • antd-mobile/lib/modal/style/css.web
  • antd-mobile/lib/modal/style/index
  • antd-mobile/lib/modal/style/index.css
  • antd-mobile/lib/nav-bar/index.web
  • antd-mobile/lib/nav-bar/style/css.web
  • antd-mobile/lib/nav-bar/style/index.less
  • antd-mobile/lib/notice-bar
  • antd-mobile/lib/notice-bar/index
  • antd-mobile/lib/notice-bar/index.web
  • antd-mobile/lib/notice-bar/style
  • antd-mobile/lib/notice-bar/style/index
  • antd-mobile/lib/pagination
  • antd-mobile/lib/pagination/index
  • antd-mobile/lib/pagination/index.web
  • antd-mobile/lib/pagination/style
  • antd-mobile/lib/picker
  • antd-mobile/lib/picker/index
  • antd-mobile/lib/picker/index.web
  • antd-mobile/lib/picker/style
  • antd-mobile/lib/picker/style/index
  • antd-mobile/lib/popover
  • antd-mobile/lib/popover/index
  • antd-mobile/lib/popover/index.web
  • antd-mobile/lib/popup
  • antd-mobile/lib/popup/index
  • antd-mobile/lib/popup/index.web
  • antd-mobile/lib/popup/style/index
  • antd-mobile/lib/progress
  • antd-mobile/lib/progress/index
  • antd-mobile/lib/progress/index.web
  • antd-mobile/lib/progress/style
  • antd-mobile/lib/progress/style/index
  • antd-mobile/lib/radio
  • antd-mobile/lib/radio/RadioItem
  • antd-mobile/lib/radio/index
  • antd-mobile/lib/radio/index.web
  • antd-mobile/lib/radio/style
  • antd-mobile/lib/radio/style/index
  • antd-mobile/lib/refresh-control
  • antd-mobile/lib/refresh-control/index.web
  • antd-mobile/lib/refresh-control/style/css.web
  • antd-mobile/lib/result/index.web
  • antd-mobile/lib/search-bar
  • antd-mobile/lib/search-bar/index
  • antd-mobile/lib/search-bar/index.web
  • antd-mobile/lib/search-bar/style
  • antd-mobile/lib/search-bar/style/index
  • antd-mobile/lib/segmented-control/index.web
  • antd-mobile/lib/segmented-control/style
  • antd-mobile/lib/segmented-control/style/index
  • antd-mobile/lib/slider
  • antd-mobile/lib/slider/index
  • antd-mobile/lib/slider/index.web
  • antd-mobile/lib/stepper
  • antd-mobile/lib/stepper/index
  • antd-mobile/lib/stepper/index.web
  • antd-mobile/lib/steps
  • antd-mobile/lib/steps/index
  • antd-mobile/lib/steps/index.web
  • antd-mobile/lib/steps/style
  • antd-mobile/lib/steps/style/index
  • antd-mobile/lib/swipe-action/index.web
  • antd-mobile/lib/swipe-action/style
  • antd-mobile/lib/swipe-action/style/index
  • antd-mobile/lib/switch
  • antd-mobile/lib/switch/index
  • antd-mobile/lib/switch/index.web
  • antd-mobile/lib/tab-bar/index.web
  • antd-mobile/lib/tab-bar/style
  • antd-mobile/lib/tab-bar/style/index
  • antd-mobile/lib/tab-bar/style/index.less
  • antd-mobile/lib/table/index.web
  • antd-mobile/lib/tabs
  • antd-mobile/lib/tabs/index
  • antd-mobile/lib/tabs/index.web
  • antd-mobile/lib/tabs/style
  • antd-mobile/lib/tabs/style/index
  • antd-mobile/lib/tabs/style/index.less
  • antd-mobile/lib/tag
  • antd-mobile/lib/tag/index
  • antd-mobile/lib/tag/index.web
  • antd-mobile/lib/tag/style
  • antd-mobile/lib/tag/style/index
  • antd-mobile/lib/text
  • antd-mobile/lib/text/index.web
  • antd-mobile/lib/textarea-item
  • antd-mobile/lib/textarea-item/index
  • antd-mobile/lib/textarea-item/index.web
  • antd-mobile/lib/textarea-item/style
  • antd-mobile/lib/textarea-item/style/index
  • antd-mobile/lib/toast
  • antd-mobile/lib/toast/index
  • antd-mobile/lib/toast/index.web
  • antd-mobile/lib/toast/style
  • antd-mobile/lib/toast/style/css.web
  • antd-mobile/lib/toast/style/index
  • antd-mobile/lib/view
  • antd-mobile/lib/view/index.web
  • antd-mobile/lib/white-space
  • antd-mobile/lib/white-space/index
  • antd-mobile/lib/white-space/index.web
  • antd-mobile/lib/wing-blank
  • antd-mobile/lib/wing-blank/index
  • antd-mobile/lib/wing-blank/index.web
  • antd-mobile/package
  • antd-mobile/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (antd-mobile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Ant Design Mobile npm package NPM downloads Dependency Status

A configurable Mobile UI specification and React-based implementation.

Features

  • Follow Ant Design Mobile UI specification.
  • Configurable UI style for different products.
  • Support web and native usages based on React Native.
  • Develop in TypeScript.

Demo

mobile web demo

http://mobile.ant.design/kitchen-sink/

react native demo

Install

$ npm install antd-mobile --save

Usage

Web

import 'antd-mobile/lib/button/style';
import Button from 'antd-mobile/lib/button';

ReactDOM.render(<Button>Start</Button>, mountNode);

Set webpack to resolve .web.js suffix

resolve: {
  modulesDirectories: ['node_modules', path.join(__dirname, '../node_modules')],
  extensions: ['', '.web.js', '.js', '.json'],
},

React-Native

import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import Button from 'antd-mobile/lib/button';

class HelloWorldApp extends Component {
  render() {
    return <Button>Start</Button>;
  }
}

AppRegistry.registerComponent('HelloWorldApp', () => HelloWorldApp);

Use babel-plugin-import

Use babel-plugin-import (Recommended) to reduce bundle size.

// .babelrc
// no need to set style property in react-native
{
 "plugins": [["import", { "style": "css", "libraryName": "antd-mobile" }]]
}

Then you can import components from antd-mobile directly.

// import js and css modularly, parsed by babel-plugin-import
import { Button } from 'antd-mobile';

Browser Support

  • iOS
  • Android 4.0+

Contributing

We welcome all contributions, please read our CONTRIBUTING.md first. You can submit any ideas as pull requests or as a GitHub issue. If you'd like to improve code, check out the Development Instruction and have a good time! :)