This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index at /llms.txt, or add .md to any page's URL.

Components, providers, and slots

A component declares its public inputs under props. Every declared prop must be supplied exactly once, with a compatible type; props have no defaults. An action prop passes behavior without giving a child access to its parent's state.
contract
component App
state chosen = ""
action choose(value: string)
chosen = value
view
column gap=8
Choice(title="One", select=choose)
text chosen testId="chosen"
component Choice
props
title: string
select: action
view
button press=select(title) testId="choice"
text title
For values needed throughout a component tree, use a component provide section and a descendant's typed inject section:
contract
component App
provide
accent = "-exact-system-indigo"
view
Label(title="Hello")
component Label
props
title: string
inject
accent: string
view
text title color=accent
A bare provider entry, such as accent, provides the existing value of that name. A provider covers the component's entire view. The nearest providing component wins. An unsatisfied injection is a compile error. provide name = value inside a view is obsolete; use the component section shown above.
A slot allows a component to wrap caller-authored children:
contract
component App
view
Card()
text "Inside the card"
component Card
slot
view
column padding=16 border-radius=12 background-color="-exact-secondary-background"
children
Declare slot on the receiving component and place children in its view. The supplied children retain their caller's lexical scope and providers. This is one slot, not named slots or an arbitrary render-function API.
Is this helpful
Last updated November 30, 2026
Exact Docs