icon-button
Skill2 starsChanged 13 days agoMITView on GitHub
Conventions for icon-only buttons and hover tooltips in the Patio web UI (web/src). Use when adding or changing any button that shows only an icon (header actions, toolbar buttons, row actions, open-in-window, delete, collapse), or any element that needs a hover/focus tooltip, so it gets the shared `IconButton`, an accessible name, and the custom `data-tip` tooltip instead of a native `title`.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibilitySkill
- connector-requiredSkill
- dropdown-buttonSkill
- frontend-designSkill
- golang-patternsSkill
- golang-testingSkill
- list-viewSkill
- releaseSkill
- searchable-dropdownSkill
- seoSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Don't hand-roll <button><Icon /></button> for an icon-only action, and don't use title= for tooltips.
- Distinctive: line 42
No colored accent stripes (AGENTS.md).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Icon buttons and tooltips
Reference: IconButton and Icon in web/src/icons.tsx; [data-tip] rules in web/src/styles.css. Examples: the chat header in web/src/Chats.tsx (Open in new window, Delete chat) and the sidebar collapse button in web/src/App.tsx.
The component
import { IconButton } from "./icons";
<IconButton className="ghost" icon="externalLink" label="Open in new window" onClick={open} />
<IconButton className="danger-text" icon="trash" label="Delete chat" onClick={remove} />label becomes both aria-label (screen readers) and data-tip (the visible tooltip), so one string covers both. Write it as a short action in sentence case: "Delete chat", not "Delete" or "delete-chat". Pass the type explicitly (type="button") inside forms so it doesn't submit.
Don't hand-roll <button><Icon /></button> for an icon-only action, and don't use title= for tooltips; the native tooltip is slow, unstyled, and duplicates the label for screen readers.
Icons
Icons are Lucide paths (ISC) in the paths map in icons.tsx, drawn on a 24×24 stroke grid. To add one, copy the path data from the matching Lucide icon and give it a camelCase key. Check it renders at 16px before shipping; hand-edited paths tend to look broken.
Styles
- Variant classes go in
className:ghostfor quiet header and toolbar actions,danger-textfor destructive ones.iconis added automatically. - Size: every icon button is a 40×40 square (
.iconsetswidth: 40pxandflex-shrink: 0). Don't override width, height, or padding, and don't put it in a flex container that stretches or squashes it (e.g.flex: 1on the button in a column). Icon-only nav items in the collapsed sidebar follow the same 40×40 size and the button radius (--radius-field). - Tooltip placement: below and centered by default. Add
tip-upwhen the button sits near the bottom of a scroll area, andtip-widefor text longer than a few words (wraps at 260px). Inside.sidebar, the tooltip appears to the right. - The tooltip shows after 0.4s hover, and right away on keyboard focus.
- For a tooltip on something that isn't an icon button (a help mark, a chip), set
data-tip="..."on the element and keep a real accessible name on it.
Checklist
- Uses
IconButton, not a custom button. - Renders as a 40×40 square in every layout, including collapsed sidebars and scrolling columns.
labelis a clear action and matches what the button does.- No
title=on the same element. - Reachable by keyboard; tooltip visible on focus.
- No colored accent stripes (AGENTS.md).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

