|
1 | 1 | <p align="center"> |
2 | | - <a href="http://tiny-ui.org"> |
| 2 | + <a href="https://tiny-ui.dev"> |
3 | 3 | <img width="200" src="https://github.com/wangdicoder/tiny-ui/blob/master/site/src/assets/logo/logo.svg"> |
4 | 4 | </a> |
5 | 5 | </p> |
6 | 6 |
|
7 | 7 | <h1 align="center">Tiny UI</h1> |
8 | | -<p align="center">A Friendly UI Component Set for React</p> |
| 8 | +<p align="center">A friendly UI component set for React</p> |
9 | 9 |
|
10 | 10 | <p align="center"> |
11 | | - <a href="https://www.npmjs.com/package/tiny-ui" target="_blank"> |
12 | | - <img src="https://img.shields.io/npm/v/tiny-ui.svg?style=flat-square"/> |
| 11 | + <a href="https://www.npmjs.com/package/tiny-ui"> |
| 12 | + <img src="https://img.shields.io/npm/v/tiny-ui.svg?style=flat-square" alt="npm version"/> |
13 | 13 | </a> |
14 | | - <a href="https://www.npmjs.com/package/tiny-ui" target="_blank"> |
15 | | - <img src="https://img.shields.io/npm/dm/tiny-ui.svg?style=flat-square"> |
| 14 | + <a href="https://www.npmjs.com/package/tiny-ui"> |
| 15 | + <img src="https://img.shields.io/npm/dm/tiny-ui.svg?style=flat-square" alt="npm downloads"/> |
16 | 16 | </a> |
17 | | - <a href="https://bundlephobia.com/package/tiny-ui" target="_blank"> |
18 | | - <img src="https://img.shields.io/bundlephobia/minzip/tiny-ui.svg?style=flat-square"> |
| 17 | + <a href="https://bundlephobia.com/package/tiny-ui"> |
| 18 | + <img src="https://img.shields.io/bundlephobia/minzip/tiny-ui.svg?style=flat-square" alt="bundle size"/> |
19 | 19 | </a> |
20 | | - <br> |
21 | | - <a href="https://react.dev" target="_blank"> |
22 | | - <img src="https://img.shields.io/static/v1?label=react&message=%3E=18&color=61dafb&style=flat-square"> |
| 20 | + <a href="https://react.dev"> |
| 21 | + <img src="https://img.shields.io/static/v1?label=react&message=%3E=18&color=61dafb&style=flat-square" alt="react version"/> |
23 | 22 | </a> |
24 | | - <a href="https://github.com/wangdicoder/tiny-ui/issues" target="_blank"> |
25 | | - <img src="https://img.shields.io/github/issues/wangdicoder/tiny-ui.svg?style=flat-square"> |
26 | | - </a> |
27 | | - <a href="https://github.com/wangdicoder/tiny-ui/blob/master/LICENSE" target="_blank"> |
28 | | - <img src="https://img.shields.io/npm/l/tiny-ui.svg?style=flat-square"> |
| 23 | + <a href="https://github.com/wangdicoder/tiny-ui/blob/master/LICENSE"> |
| 24 | + <img src="https://img.shields.io/npm/l/tiny-ui.svg?style=flat-square" alt="license"/> |
29 | 25 | </a> |
30 | 26 | </p> |
31 | 27 |
|
| 28 | +--- |
32 | 29 |
|
33 | | -## 📦 Install |
| 30 | +## Features |
34 | 31 |
|
35 | | -Use npm |
| 32 | +- 65+ high-quality React components |
| 33 | +- Written in **TypeScript** with complete type definitions |
| 34 | +- Entirely built with function components and **React Hooks** |
| 35 | +- **Dark mode** support with system preference detection |
| 36 | +- **i18n** built-in — English and Chinese out of the box |
| 37 | +- Follows [WAI-ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) accessibility standards |
| 38 | +- Customisable themes via SCSS variables |
| 39 | +- Supports tree-shaking for minimal bundle size |
36 | 40 |
|
37 | | -```bash |
38 | | -npm install tiny-ui --save |
39 | | -``` |
| 41 | +## Component Categories |
40 | 42 |
|
41 | | -Use yarn |
| 43 | +| Category | Components | Examples | |
| 44 | +| -------- | :--------: | -------- | |
| 45 | +| Foundation | 5 | Button, Icon, Image, Link, Typography | |
| 46 | +| Layout | 6 | Grid, Space, Split, Divider, Aspect Ratio | |
| 47 | +| Navigation | 5 | Menu, Breadcrumb, Dropdown, Pagination, Steps | |
| 48 | +| Data Display | 15 | Card, Carousel, Collapse, Tag, Tooltip, Tree | |
| 49 | +| Form | 17 | Input, Select, DatePicker, TimePicker, Checkbox, Radio, Slider | |
| 50 | +| Feedback | 12 | Modal, Drawer, Message, Notification, Alert, Skeleton | |
| 51 | +| Miscellany | 5 | ConfigProvider, BackTop, Sticky, Keyboard | |
| 52 | + |
| 53 | +## Install |
42 | 54 |
|
43 | 55 | ```bash |
| 56 | +# npm |
| 57 | +npm install tiny-ui |
| 58 | + |
| 59 | +# yarn |
44 | 60 | yarn add tiny-ui |
45 | 61 | ``` |
46 | 62 |
|
47 | | -## 🔨 Quick Start |
| 63 | +## Quick Start |
48 | 64 |
|
49 | | -```js |
| 65 | +```jsx |
50 | 66 | import { Button, Switch } from 'tiny-ui'; |
| 67 | +import 'tiny-ui/dist/styles/index.css'; |
51 | 68 |
|
52 | 69 | const App = () => ( |
53 | 70 | <> |
54 | 71 | <Button btnType="primary">Click Me</Button> |
55 | | - <Switch checked/> |
| 72 | + <Switch checked /> |
56 | 73 | </> |
57 | 74 | ); |
58 | 75 | ``` |
59 | 76 |
|
60 | | -And import style manually: |
| 77 | +### On-demand loading |
61 | 78 |
|
62 | | -```js |
63 | | -import 'tiny-ui/dist/styles/index.css'; |
| 79 | +Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) to load components and styles on demand: |
| 80 | + |
| 81 | +```json |
| 82 | +{ |
| 83 | + "plugins": [ |
| 84 | + ["import", { "libraryName": "tiny-ui", "style": "css" }] |
| 85 | + ] |
| 86 | +} |
64 | 87 | ``` |
65 | 88 |
|
66 | | -## 🌍 Internationalization |
| 89 | +## Theming |
67 | 90 |
|
68 | | -Built-in support for English and Chinese. Set locale via `ConfigProvider` or `IntlProvider`: |
| 91 | +### Dark mode |
| 92 | + |
| 93 | +```jsx |
| 94 | +import { ConfigProvider } from 'tiny-ui'; |
| 95 | + |
| 96 | +<ConfigProvider theme="dark"> |
| 97 | + <App /> |
| 98 | +</ConfigProvider> |
| 99 | +``` |
| 100 | + |
| 101 | +### Custom themes |
| 102 | + |
| 103 | +Override SCSS variables to customise colours, borders, fonts, and more: |
| 104 | + |
| 105 | +```scss |
| 106 | +$primary-color: #007bff; |
| 107 | +$font-path: '~tiny-ui/themes/fonts'; |
| 108 | +@import '~tiny-ui/themes/index.scss'; |
| 109 | +``` |
| 110 | + |
| 111 | +See the [Theme Customisation Guide](https://tiny-ui.dev/guide/customise-theme) for details. |
| 112 | + |
| 113 | +## Internationalization |
| 114 | + |
| 115 | +Built-in locale support for English and Chinese. Set locale via `ConfigProvider` or `IntlProvider`: |
69 | 116 |
|
70 | 117 | ```jsx |
71 | 118 | import { ConfigProvider, zh_CN } from 'tiny-ui'; |
72 | 119 |
|
73 | | -const App = () => ( |
74 | | - <ConfigProvider locale={zh_CN}> |
75 | | - <MyApp /> |
76 | | - </ConfigProvider> |
77 | | -); |
| 120 | +<ConfigProvider locale={zh_CN}> |
| 121 | + <App /> |
| 122 | +</ConfigProvider> |
78 | 123 | ``` |
79 | 124 |
|
80 | 125 | | Locale | Language | |
81 | 126 | | ------ | -------- | |
82 | 127 | | en_US | English (default) | |
83 | 128 | | zh_CN | 简体中文 | |
84 | 129 |
|
85 | | -## 🖥 Browser Support |
| 130 | +## Browser Support |
| 131 | + |
| 132 | +Supports all modern browsers. IE is **not** supported. |
86 | 133 |
|
87 | | -Supports all major modern browsers. |
| 134 | +| <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="Edge" width="24px" height="24px" /><br>Edge | <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" /><br>Firefox | <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" /><br>Chrome | <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" /><br>Safari | |
| 135 | +| --- | --- | --- | --- | |
| 136 | +| last 2 versions | last 2 versions | last 2 versions | last 2 versions | |
88 | 137 |
|
89 | | -| <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" /></br>IE | <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" /></br>Edge | <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" /></br>Firefox | <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" /> </br>Chrome | <img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" /></br>Safari | |
90 | | -| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | |
91 | | -| >=11 | >= 14 | last 2 versions | last 2 versions | last 2 versions | |
| 138 | +## Links |
92 | 139 |
|
| 140 | +- [Documentation](https://tiny-ui.dev) |
| 141 | +- [Changelog](https://github.com/wangdicoder/tiny-ui/blob/master/CHANGELOG.md) |
| 142 | +- [Issues](https://github.com/wangdicoder/tiny-ui/issues) |
93 | 143 |
|
94 | | -## 🔗 Links |
| 144 | +## License |
95 | 145 |
|
96 | | -- [Home page](https://tiny-ui.dev) |
| 146 | +[MIT](https://github.com/wangdicoder/tiny-ui/blob/master/LICENSE) |
0 commit comments