author-ui-components

Guides authoring of Remix packages/ui components including primitives, styled wrappers, and style mixins.

33.3k|2.8k|Updated Oct 26, 2020
One-click install
npx skills add https://github.com/remix-run/remix --skill author-ui-components
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: author-ui-components
Source: https://github.com/remix-run/remix/tree/main/.agents/skills/author-ui-components
Command: npx skills add https://github.com/remix-run/remix --skill author-ui-components

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building consistent UI components in Remix's packages/ui requires following specific layering rules, runtime patterns, and public API conventions that are easy to get wrong without guidance.

Core Features & Use Cases

  • Layered Architecture Guidance: Defines when to use style helpers, headless primitives, styled wrappers, or shared utilities, with composition rules like select composing popover and listbox.
  • Runtime and Context Patterns: Documents the two-phase component shape with Handle, context providers with getters and methods, and mixin creation via createMixin.
  • Public API Conventions: Covers named exports with namespace imports, bubbling DOM events like SelectChangeEvent, css() styling descriptors, and testing/demo requirements.
  • Use Case: When adding a new component like a toggle switch to packages/ui, follow the checklist to place source under src/<name>, wire exports in package.json, write primitive and wrapper tests, and register demos in componentDemoModules.

Quick Start

Use the author-ui-components skill to scaffold a new accordion-style component in packages/ui with primitives, styled wrappers, tests, and docs.

Frequently Asked Questions about author-ui-components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new UI component in Remix packages/ui?

Create a module under packages/ui/src/<name> with index.ts as the public entry, add primitives.ts if the component needs headless behavior, and update exports and publishConfig.exports in packages/ui/package.json. Add tests, demos, and a README importing from remix/ui/....

What is the difference between primitives and styled wrappers in Remix UI?

Primitives own behavior, ARIA, keyboard handling, refs, and public events through named providers and mixins. Styled wrappers compose primitives with shared styles and icons for an ergonomic API without duplicating primitive behavior.

How do Remix UI components manage state and rendering?

Components use a two-phase shape: a setup function receiving a Handle returns a render function returning RemixNode. State lives in setup scope, updates are scheduled with handle.update(), and post-render work uses handle.queueTask().

When should I use a style helper versus a headless primitive?

Use a style helper when the job only needs css() descriptors and a small default-attr mixin, like button() or input.root(). Choose a headless primitive when the component owns behavior, ARIA, registration, keyboard handling, or public events.

How do public events work in Remix UI components?

Public contracts use bubbling DOM events with a constant like 'rmx:select-change', an exported event class with readonly payload fields, and an on<Component><Action> mixin wrapping on(...). Stateful components also support callback props such as onValueChange.