Skip to content

Commit 736c620

Browse files
committed
docs: revamp README and fix pre-commit formatting with lint-staged
README: - Restructure for developers discovering the project on GitHub - Add hero image, centered navigation links, code snippet, "Why Tool UI?" section, contributing section - Move images to .github/assets/ so they render on GitHub - Fix LICENSE link Pre-commit: - Replace manual oxfmt shell script with lint-staged (official recommendation) - The old script swallowed errors via `2>/dev/null || true`, letting unformatted code through and blocking pushes later - lint-staged handles staged file filtering, formatting, and re-staging correctly, including partial staging Closes #150
1 parent 86ba3c7 commit 736c620

9 files changed

Lines changed: 242 additions & 74 deletions

File tree

.githooks/pre-commit

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,4 @@ set -eu
33

44
pnpm hooks:pre-commit
55

6-
# Auto-fix formatting on staged files and re-stage them
7-
STAGED=$(git diff --cached --name-only --diff-filter=ACMR)
8-
if [ -n "$STAGED" ]; then
9-
WWW_STAGED=$(echo "$STAGED" | grep '^apps/www/' || true)
10-
if [ -n "$WWW_STAGED" ]; then
11-
echo "$WWW_STAGED" | sed 's|^apps/www/||' | (cd apps/www && xargs oxfmt 2>/dev/null) || true
12-
echo "$WWW_STAGED" | xargs git add
13-
fi
14-
fi
6+
pnpm lint-staged

.github/assets/gallery.png

1.39 MB
Loading

.github/assets/header.png

192 KB
Loading

.github/assets/homepage.png

2.21 MB
Loading

.github/assets/option-list.png

40.7 KB
Loading

.github/assets/question-flow.png

57.5 KB
Loading

README.md

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,61 @@
1-
# Tool UI
1+
<a href="https://tool-ui.com">
2+
<img src=".github/assets/header.png" alt="Tool UI" width="100%">
3+
</a>
24

35
Copy/paste React components for rendering tool calls in AI chat interfaces. Built by [assistant-ui](https://github.com/assistant-ui).
46

5-
When a model calls a tool, most apps dump raw JSON into the conversation. These components turn tool payloads into interactive UI — approvals, forms, tables, charts, media cards, and receipts — so users can understand and act without leaving the chat.
7+
**[Docs](https://tool-ui.com/docs/overview)** · **[Gallery](https://tool-ui.com/docs/gallery)** · **[Quick Start](https://tool-ui.com/docs/quick-start)**
68

7-
<p align="center">
8-
<img src="public/assets/homepage.png" alt="Tool UI – UI components for AI interfaces" width="880">
9-
</p>
10-
11-
**[tool-ui.com](https://tool-ui.com)** | [Docs](https://tool-ui.com/docs/overview) | [Gallery](https://tool-ui.com/docs/gallery) | [Quick Start](https://tool-ui.com/docs/quick-start)
12-
13-
## Gallery
9+
When a model calls a tool, most apps dump raw JSON into the conversation. These components turn tool payloads into interactive UI like approvals, forms, tables, charts, and media cards so users can understand and act without leaving the chat.
1410

15-
<p align="center">
16-
<img src="public/assets/gallery.png" alt="Tool UI component gallery – weather, message draft, code block, image gallery, order summary, chart, and plan components" width="900">
17-
</p>
11+
## Featured Components
1812

19-
## Featured components
20-
21-
<table>
13+
<table border="0" cellspacing="0" cellpadding="0">
2214
<tr>
23-
<td align="center" width="50%">
15+
<td valign="top" width="50%">
2416
<strong>Option List</strong><br>
25-
<em>Let users select from multiple choices</em><br>
26-
<img src="public/assets/option-list.png" alt="Option List component" width="400">
17+
Let users select from multiple choices<br><br>
18+
<a href="https://tool-ui.com/docs/option-list">
19+
<img src=".github/assets/option-list.png" alt="Option List component" width="100%">
20+
</a>
2721
</td>
28-
<td align="center" width="50%">
22+
<td valign="top" width="50%">
2923
<strong>Question Flow</strong><br>
30-
<em>Multi-step guided questions with branching</em><br>
31-
<img src="public/assets/question-flow.png" alt="Question Flow component" width="400">
24+
Multi-step guided questions with branching<br><br>
25+
<a href="https://tool-ui.com/docs/question-flow">
26+
<img src=".github/assets/question-flow.png" alt="Question Flow component" width="100%">
27+
</a>
3228
</td>
3329
</tr>
3430
</table>
3531

32+
33+
## Why Tool UI?
34+
35+
- **Copy/paste, not install** — shadcn/ui model. Components live in your codebase. No dependency lock-in.
36+
- **Schema-validated** — Every component has a Zod schema. Parse tool output, render when valid, fail safely when not.
37+
- **Interactive with receipts** — Components aren't just displays. Users make choices that flow back to the assistant. Choices persist as receipts.
38+
- **Built on shadcn/ui** — Radix primitives, Tailwind styling, your theme. No new design system to learn.
39+
3640
## Components
3741

38-
- **Decision/Confirmation**: Approval Card, Order Summary, Message Draft, Option List
39-
- **Input/Configuration**: Parameter Slider, Preferences Panel, Question Flow
40-
- **Display/Artifacts**: Data Table, Chart, Citation, Link Preview, Stats Display, Code Block, Code Diff, Terminal
41-
- **Media/Creative**: Image, Image Gallery, Video, Audio, Instagram Post, LinkedIn Post, X Post
42-
- **Progress/Execution**: Plan, Progress Tracker, Weather Widget
42+
- **Progress**: Plan, Progress Tracker
43+
- **Input**: Option List, Parameter Slider, Preferences Panel, Question Flow
44+
- **Display**: Citation, Geo Map, Item Carousel, Link Preview, Stats Display, Terminal, Weather Widget
45+
- **Artifacts**: Chart, Code Block, Code Diff, Data Table, Instagram Post, LinkedIn Post, Message Draft, X Post
46+
- **Confirmation**: Approval Card, Order Summary
47+
- **Media**: Audio, Image, Image Gallery, Video
4348

4449
Each component includes a Zod schema for payload validation and presets for realistic example data. Browse them all in the [Gallery](https://tool-ui.com/docs/gallery).
4550

51+
<p align="center">
52+
<img src=".github/assets/gallery.png" alt="Tool UI component gallery" width="900">
53+
</p>
54+
55+
## Contributing
56+
57+
Contributions are welcome. [Open an issue](https://github.com/assistant-ui/tool-ui/issues) to report bugs or suggest new components.
58+
4659
## License
4760

48-
MIT License. See [LICENSE](LICENSE) for details.
61+
MIT License. See [LICENSE](LICENSE.md) for details.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@
3434
},
3535
"devDependencies": {
3636
"@changesets/cli": "^2.29.8",
37+
"lint-staged": "^16.4.0",
3738
"tsx": "^4.21.0"
3839
},
3940
"engines": {
4041
"node": ">=20",
4142
"pnpm": ">=8.0.0"
4243
},
44+
"lint-staged": {
45+
"apps/www/**/*.{ts,tsx,js,jsx,mjs,cjs,css,json,jsonc}": "npx oxfmt --no-error-on-unmatched-pattern"
46+
},
4347
"packageManager": "pnpm@10.11.0"
4448
}

0 commit comments

Comments
 (0)