Skip to content

Commit 5077417

Browse files
committed
docs: update README with theme editor and improved structure
- Feature the visual Theme Editor with 20+ presets - Add quick-links bar (Documentation, Theme Editor, Theming Guide) - Add @tiny-design/icons to packages table - Fix docs site URL to GitHub Pages - Fix SCSS import path to @tiny-design/react - Add Contributing section with dev commands
1 parent b1af93b commit 5077417

1 file changed

Lines changed: 79 additions & 60 deletions

File tree

README.md

Lines changed: 79 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<p align="center">
2-
<a href="https://tiny-design.dev">
2+
<a href="https://wangdicoder.github.io/tiny-design/">
33
<img width="200" src="https://github.com/wangdicoder/tiny-design/blob/master/apps/docs/src/assets/logo/logo.svg">
44
</a>
55
</p>
66

77
<h1 align="center">Tiny Design</h1>
8-
<p align="center">A friendly UI component set for React</p>
8+
<p align="center">A friendly, themeable UI component library for React</p>
99

1010
<p align="center">
1111
<a href="https://www.npmjs.com/package/@tiny-design/react">
@@ -25,53 +25,30 @@
2525
</a>
2626
</p>
2727

28-
---
29-
30-
## Features
31-
32-
- 80+ 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 design tokens and SCSS variables
39-
- Supports tree-shaking for minimal bundle size
40-
41-
## Packages
28+
<p align="center">
29+
<a href="https://wangdicoder.github.io/tiny-design/"><strong>Documentation</strong></a> &nbsp;&bull;&nbsp;
30+
<a href="https://wangdicoder.github.io/tiny-design/theme/theme-editor"><strong>Theme Editor</strong></a> &nbsp;&bull;&nbsp;
31+
<a href="https://wangdicoder.github.io/tiny-design/guide/customise-theme"><strong>Theming Guide</strong></a>
32+
</p>
4233

43-
| Package | Description |
44-
| ------- | ----------- |
45-
| [@tiny-design/react](./packages/react) | Core component library |
46-
| [@tiny-design/tokens](./packages/tokens) | Design tokens and foundational styles |
34+
---
4735

48-
## Component Categories
36+
## Highlights
4937

50-
| Category | Components | Examples |
51-
| -------- | :--------: | -------- |
52-
| Foundation | 5 | Button, Icon, Image, Link, Typography |
53-
| Layout | 7 | Grid, Flex, Space, Split, Divider, Aspect Ratio |
54-
| Navigation | 7 | Menu, Breadcrumb, Dropdown, Pagination, Steps, Anchor, SpeedDial |
55-
| Data Display | 19 | Card, Carousel, Collapse, Tag, Tooltip, Tree, Table |
56-
| Form | 22 | Input, Select, DatePicker, TimePicker, Checkbox, Radio, Slider |
57-
| Feedback | 13 | Modal, Drawer, Overlay, Message, Notification, Alert, Skeleton |
58-
| Miscellany | 5 | ConfigProvider, BackTop, Sticky, Keyboard, CopyToClipboard |
38+
- **80+ components** — buttons, forms, data display, navigation, feedback, and more
39+
- **Visual Theme Editor** — 20+ built-in presets inspired by popular design systems; customise colours, typography, and spacing in real time without writing code
40+
- **Dark mode** — built-in light/dark themes with system preference detection and a `useTheme` hook
41+
- **TypeScript** — written in strict TypeScript with complete type definitions
42+
- **Accessible** — follows [WAI-ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) standards with keyboard navigation support
43+
- **Lightweight** — tree-shakeable ESM/CJS builds; styles auto-import alongside components
44+
- **i18n** — English and Chinese built in
5945

60-
## Install
46+
## Quick Start
6147

6248
```bash
63-
# npm
64-
npm install @tiny-design/react
65-
66-
# yarn
67-
yarn add @tiny-design/react
68-
69-
# pnpm
7049
pnpm add @tiny-design/react
7150
```
7251

73-
## Quick Start
74-
7552
```jsx
7653
import { Button, Switch } from '@tiny-design/react';
7754

@@ -83,36 +60,76 @@ const App = () => (
8360
);
8461
```
8562

86-
Styles are automatically imported alongside each component — no separate CSS import needed. Modern bundlers (webpack, Vite, Rollup) will tree-shake unused components and their styles.
63+
No separate CSS import needed — styles are bundled with each component and tree-shaken by modern bundlers.
8764

8865
## Theming
8966

67+
### Visual Theme Editor
68+
69+
The built-in [Theme Editor](https://wangdicoder.github.io/tiny-design/theme/theme-editor) lets you pick from 20+ preset themes or fine-tune individual tokens — colours, typography, border radius, spacing — and see changes live on real components. Export as CSS or SCSS when you're done.
70+
9071
### Dark mode
9172

9273
```jsx
93-
import { ConfigProvider } from '@tiny-design/react';
74+
import { useTheme } from '@tiny-design/react';
9475

95-
<ConfigProvider theme="dark">
96-
<App />
97-
</ConfigProvider>
76+
function ThemeToggle() {
77+
const { resolvedTheme, toggle } = useTheme();
78+
return <button onClick={toggle}>{resolvedTheme}</button>;
79+
}
9880
```
9981

100-
### Custom themes
82+
Or set it declaratively:
10183

102-
Override SCSS variables to customise colours, borders, fonts, and more:
84+
```html
85+
<html data-tiny-theme="dark">
86+
```
87+
88+
### CSS custom properties
89+
90+
Every visual token is a `--ty-*` CSS custom property. Override any of them:
91+
92+
```css
93+
:root {
94+
--ty-color-primary: #3b82f6;
95+
--ty-color-bg: #fafafa;
96+
--ty-border-radius: 8px;
97+
}
98+
```
99+
100+
### SCSS variables
101+
102+
For compile-time control, override `!default` SCSS variables before importing:
103103

104104
```scss
105-
@use '@tiny-design/tokens/scss/variables' with (
106-
$primary-color: #007bff
107-
);
108-
@use '@tiny-design/tokens/scss/base';
105+
$primary-color: #3b82f6;
106+
$border-radius: 8px;
107+
@use "@tiny-design/react/es/style/index" as *;
109108
```
110109

111-
See the [Theme Customisation Guide](https://tiny-design.dev/guide/customise-theme) for details.
110+
See the [Theming Guide](https://wangdicoder.github.io/tiny-design/guide/customise-theme) for the full list of tokens and variables.
112111

113-
## Internationalization
112+
## Packages
113+
114+
| Package | Description |
115+
| ------- | ----------- |
116+
| [@tiny-design/react](./packages/react) | Core component library |
117+
| [@tiny-design/tokens](./packages/tokens) | Design tokens and foundational styles |
118+
| [@tiny-design/icons](./packages/icons) | SVG icon components |
119+
120+
## Components
121+
122+
| Category | Count | Examples |
123+
| -------- | :---: | -------- |
124+
| Foundation | 5 | Button, Icon, Image, Link, Typography |
125+
| Layout | 7 | Grid, Flex, Space, Split, Divider, Aspect Ratio |
126+
| Navigation | 7 | Menu, Breadcrumb, Dropdown, Pagination, Steps, Anchor, SpeedDial |
127+
| Data Display | 19 | Card, Carousel, Collapse, Tag, Tooltip, Tree, Table |
128+
| Form | 22 | Input, Select, DatePicker, TimePicker, Checkbox, Radio, Slider |
129+
| Feedback | 13 | Modal, Drawer, Overlay, Message, Notification, Alert, Skeleton |
130+
| Miscellany | 5 | ConfigProvider, BackTop, Sticky, Keyboard, CopyToClipboard |
114131

115-
Built-in locale support for English and Chinese. Set locale via `ConfigProvider` or `IntlProvider`:
132+
## Internationalization
116133

117134
```jsx
118135
import { ConfigProvider, zh_CN } from '@tiny-design/react';
@@ -129,17 +146,19 @@ import { ConfigProvider, zh_CN } from '@tiny-design/react';
129146

130147
## Browser Support
131148

132-
Supports all modern browsers. IE is **not** supported.
133-
134149
| <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 |
135150
| --- | --- | --- | --- |
136151
| last 2 versions | last 2 versions | last 2 versions | last 2 versions |
137152

138-
## Links
153+
## Contributing
139154

140-
- [Documentation](https://tiny-design.dev)
141-
- [Changelog](https://github.com/wangdicoder/tiny-design/blob/master/CHANGELOG.md)
142-
- [Issues](https://github.com/wangdicoder/tiny-design/issues)
155+
```bash
156+
pnpm install # install dependencies
157+
pnpm dev # start docs dev server
158+
pnpm build # build all packages
159+
pnpm test # run tests
160+
pnpm lint # lint code
161+
```
143162

144163
## License
145164

0 commit comments

Comments
 (0)