agentleFS
iricardofernandesiricardofernandes/skills/skills/component-specs/SKILL.md

component-specs

Skill1 starsChanged 40 days agoMITView on GitHub

How common UI components should look and behave so they match the app instead of shipping browser defaults. Use when building or styling selects, comboboxes, inputs, checkboxes, radios, switches, sliders, textareas, date pickers, calendars, data tables, dialogs, sheets, drawers, popovers, dropdowns, tooltips, toasts, tabs, accordions, sidebars, pagination, skeletons, empty states, badges, avatars or buttons — with or without shadcn/ui, on Base UI by default. Triggers on layout shift when a select or popup opens, elements growing or shrinking on open, hover or focus, default-looking controls, select arrow touching the border, unstyled date picker, off-center checkmark, radio dot or switch thumb, misaligned controls, cramped or squeezed table columns, column resizing.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Style from the project's tokens: Never leave a control on the browser's colors, and never invent a one-off value inside a component.

    line 15
  2. Distinctive:

    Every state is designed: default, hover, focus-visible, active, disabled, invalid, read-only, loading, empty.

    line 16
  3. Distinctive:

    Read only the file for the family you are building.

    line 35
  4. Distinctive:

    Every indicator passes the centering measurement in alignment.md.

    line 42
  5. Distinctive:

    Every state listed above renders, in light and dark mode.

    line 43
  6. Distinctive:

    If you cannot open a browser, say which checks you could not run.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Component specs

The exact behavior and styling of the components every app needs. Browser defaults and copy-pasted examples ship controls that ignore the app's tokens: a select with its arrow against the border, a native date input in light mode inside a dark app, a checkmark one pixel off center, a table squeezing twelve columns into one screen. This skill names the standard for each.

Whether a component should exist and what its API is belongs to components. Run that first, then build to the spec here.

Universal rules

  1. Controls are one family. Input, select, combobox, textarea, date field and button share the same height, radius, border, horizontal padding, font size, and focus, invalid and disabled styles, all from tokens. Put two side by side: their edges and baselines line up.
  2. Style from the project's tokens. Never leave a control on the browser's colors, and never invent a one-off value inside a component.
  3. Every state is designed: default, hover, focus-visible, active, disabled, invalid, read-only, loading, empty. A state you did not style is a state that looks broken.
  4. Indicators are centered by layout, not by offsets. Checkmarks, radio dots, switch thumbs, chevrons and icons are centered with grid or flex on a box whose size leaves an even remainder. Never with top/left magic numbers. Read alignment.md before building any of them.
  5. Declare color-scheme. Set color-scheme: light dark (or the app's single scheme) on :root and switch it with the theme, so native popups, scrollbars, date pickers and autofill follow the theme.
  6. Build on Base UI by default. New project or no component library: @base-ui/react, or shadcn's Base UI components when the project uses shadcn. A project already on Radix, React Aria or another headless library keeps it. Fix visuals in the theme or the component file; never mix two libraries for the same role. Read base-ui.md.
  7. Nothing moves unless it was touched. Opening a select, hovering a row, focusing an input or showing an error never changes the size or position of another element. The usual causes: double scrollbar compensation when a popup locks scroll, borders or font weight that change on hover or focus, error text inserted without reserved space. See overlays.md.

Where each component's spec lives

BuildingRead
Base UI parts, data attributes, positioning variablesbase-ui.md
Checkbox, radio, switch, any centered indicator or iconalignment.md
Input, input group, select, native select, combobox, textarea, slider, OTP, field, label, buttoncontrols.md
Date picker, calendar, date range, timedates.md
Table, data table, paginationtables.md
Dialog, alert dialog, sheet, drawer, popover, dropdown, context menu, hover card, tooltip, toastoverlays.md
Tabs, accordion, collapsible, sidebar, navigation menu, breadcrumb, scroll area, carouselnavigation.md
Skeleton, spinner, progress, empty state, alert, badge, avatar, chartfeedback.md

Read only the file for the family you are building.

Verify before calling it done

Open the page in a browser (dev server plus Playwright, or the user's browser) and check:

  • Controls placed side by side have equal heights and aligned edges.
  • Every indicator passes the centering measurement in alignment.md.
  • Every state listed above renders, in light and dark mode.
  • Native popups (select options, date picker) follow the theme.
  • Opening each popup (select, menu, combobox, dialog) leaves every other element where it was: measure a flexible neighbor's width before and after opening, the difference is 0.
  • The page works at 375px wide and at 200% zoom.

If you cannot open a browser, say which checks you could not run.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.