Automatic Data Flow Between Components
Building a page from multiple components creates a question: how does data get from one component to another? A record detail page might have a header component showing the record's title, a metrics row showing calculated values, a list component showing related records, and an action panel. All of these components need data. Where does it come from, and who coordinates it?
In Swifty, data flows automatically from parent to child. Parent context is available to nested components without any manual wiring.
The Problem with Manual Wiring
In conventional component systems, data flows through explicit props. A parent component holds data and passes it down to children as configuration. This is clean in theory, but it creates maintenance overhead in practice. Add a new child component that needs a piece of data, and you need to update the parent to pass it. Change a data shape, and you need to update every component in the chain.
In a builder-driven platform where non-developers configure pages, manual wiring isn't viable. Users can't inspect prop chains.
Context as Automatic Inheritance
Swifty's component model uses context inheritance. When a component loads data — a record, a query result, a computed value — that data becomes part of the local context. Any component nested within it inherits that context automatically.
Place a detail panel component on a page that loads a specific record. Add a sub-list component inside the panel — it automatically knows which record it's nested inside and can filter its data accordingly. Add a metrics widget — it can reference fields from the parent record's context without explicit configuration.
Route Parameters Flow Through Automatically
Page-level context — route parameters, URL state, session values — flows all the way down the component tree. A list component on a page that shows /projects/{id}/tasks automatically receives the id parameter and can use it to filter the task list to the relevant project. No wiring required.
Override When Needed
Automatic context flow covers the common case, but explicit configuration is always possible. A component can be pinned to a specific data source, bypassing context inheritance. A nested component can reference a named data source from higher in the tree rather than the immediate parent. The system provides smart defaults that cover most layouts while keeping explicit control available for complex cases.
Less Configuration, More Consistency
The practical effect is that pages are easier to build. Drop components onto a page, arrange them in a logical hierarchy, and data flows where it needs to go. The number of things you need to manually configure on each component drops significantly.
This is one of the quiet but meaningful advantages of thinking in components from the start. Context inheritance only works because components were designed with a consistent data model. The upfront investment in architecture pays dividends every time someone builds a new page.