Define slots
Give each area a name in your contract. This defines the two slots in the picture:- Zod
- ArkType
- Valibot
patchsmith.ts
Describe the space
Usedescription to tell app authors and agents where a slot appears:
Inside your contract's slots
Allow multiple slot instances
By default, a slot has one instance per app, showing one view at a time. Setmultiple: true when you want separate instances that can appear together.
Use multiple instances for tiles or pages that need separate metadata:
One app can supply all of these instances. Each has its own key, metadata, and data. Tiles can appear together; page instances can each have a link and open separately.
Inside your contract's slots
Page instances
Context chooses the view
A panel can show an overview on a members list and details when a member is open. The slot selects the closest available view for the current context. Views change the UI inside an instance. Themultiple option lets an app supply separate instances.
To supply UI and instances from an app, see Write app UI.
SDK reference
Slots live indefineContract({ slots }), keyed by the names you choose.
key unique within its view, a metadata object, and schema-validated data. See Write app UI for the implementation.
Frequently asked questions
Use views to adapt an instance to page context and metadata to describe its placement or label.Do I need multiple instances to change UI between pages?
Do I need multiple instances to change UI between pages?
No. Views let one instance change with the current context. Enable
multiple when you need distinct tiles, pages, or other entries from the
same app.Does metadata have a fixed format?
Does metadata have a fixed format?
It’s an object with the fields you agree to use, such as
label, icon, or
position. Your UI decides what those fields mean.