← Graph

Prefer atomic components over slots

takeaway 3 connections

Design preference behind Ruby UI: avoid a slots-based API (as popularized by ViewComponent and Web Components) and instead ship many small, reusable, atomic components that callers compose together. Rationale from Seth Horsley: slots are less common in the JavaScript world you may be coming from, and they tightly couple a bit of markup to a single parent component, preventing reuse of those tiny pieces elsewhere.

type
recommendation
takeaway Prefer atomic components over slots
about
Ruby UI project
Ruby UI's core API design choice.
takeaway Prefer atomic components over slots
about
Explicit counterpoint — avoids the slots approach used by ViewComponent.
takeaway Prefer atomic components over slots
from_talk
Articulated in Q&A on why Ruby UI doesn't adopt slots.

Provenance