Skip to main content

gentleduck/primitives Course

Advanced, project-oriented curriculum for building accessible component systems with gentleduck/primitives.

Outcomes

After completing the course, you should be able to:

  • Build and ship design-system wrappers around primitives.
  • Choose controlled vs uncontrolled strategies intentionally.
  • Debug focus, dismissal, and layering issues quickly.
  • Implement robust motion with Presence and reduced-motion support.
  • Verify accessibility with keyboard and screen reader workflows.
  • Build quality gates that catch interaction regressions early.
  • Run an internal registry of vetted primitive wrapper examples.

How to run this course

Recommended cadence:

  1. Read one lesson.
  2. Build the lab in a local playground.
  3. Add one production constraint (async, nesting, RTL, or reduced motion).
  4. Validate with keyboard and screen reader checks.

If you only copy snippets, you will miss the behavioral contracts that matter in production.


Curriculum

#LessonCore topicProduction lens
1Why PrimitivesBehavioral abstractionWhat complexity you should never rebuild manually
2Your First DialogCompound anatomyState ownership and guarded dismiss flows
3The asChild PatternComposition modelRef safety and prop merging contracts
4Popover and PositioningPopper placementCollision strategy and anchor modeling
5Menus, Dropdowns, and SelectionComplex selection UIsKeyboard routing, item semantics, and submenus
6Animation with PresenceMount lifecycleExit timing, forceMount, and reduced-motion policy
7Accessibility Deep DiveARIA + focus rulesPractical audits and failure modes
8Building a Design SystemWrapper architectureAPI consistency, defaults, and scaling patterns
9Testing and Quality GatesReliability engineeringInteraction tests, a11y assertions, CI gates
10Operations, Migration, and Internal RegistryLong-term operationsRollout safety, governance, migration, registry

Prep checklist

Before lesson 1:

  • Install @gentleduck/primitives.
  • Create a playground app where you can iterate quickly.
  • Set document and provider direction (ltr or rtl).
  • Have one keyboard and one screen-reader pass workflow ready.

Suggested capstone

Build this in your own repo while taking the course:

  • Dialog wrapper with guarded async close.
  • Popover wrapper with side-aware motion.
  • Menu wrapper with checkbox/radio semantics.
  • Tooltip wrapper with provider defaults.
  • Internal registry entries for each wrapper with examples and test references.

If you are following this inside this monorepo, use packages/registers/registry-internal/registry-internal.ts as the internal registry entry source.

Then write a short engineering note explaining:

  • Why you chose controlled vs uncontrolled for each.
  • Which accessibility checks you automated vs manual.
  • Which defaults belong in wrappers vs app usage.

Coverage map

Use API docs as the canonical prop/event source: