← Graph

ViewComponent Slots

concept 4 connections

ViewComponent feature analogous to Web-component slots or React children: a component declares named 'holes' (renders_one / renders_many) that callers fill with blocks or nested components. Unlike the default `content` block (only evaluated when called), slot blocks are always evaluated. Enables DSL-like usage such as `stats.with_number(...)` or `header.with_breadcrumb_item(...)`. Radoslav Stankov aliases slots (`as: :number`, `as: :action`) to make the DSL read naturally.

category
pattern
about
ViewComponent Slots concept
Slots are demoed in stats, page_header, and discussed as an alternative to the builder pattern.
about
ViewComponent Slots concept
Contrasts with the slots pattern used by ViewComponent.
about
ViewComponent Slots concept
Explicit counterpoint — avoids the slots approach used by ViewComponent.
concept ViewComponent Slots
related_to
Slots are a feature of ViewComponent.

Provenance

Read by
5 extractions