Component
A Component is a named block of a Page, such as a hero, a pricing table, or a form, filled from records through typed props.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
name | string | required | The name a Template places it by, such as Pricing. |
props | json | required | The schema of the props it accepts. |
region | string | Where it sits: header, section, footer, or notice. | |
interactive | boolean | True when it runs code in the browser; it still renders a static still without it. |
Object
{
"$id": "https: //api.sb/ patentpad.com/ components/ component_1",
"$type": "Component",
"name": "PatentPad",
"props": {},
"region": "header",
"interactive": true
}Relationships
- A Component is placed by many Templates: a Template places named Components, such as
Pricing, and fills their props from records.placedBy, inverseplaces. - A Component is used on many Pages: a Page is assembled from Components, each filled from records.
usedOn, inverseuses.
Verbs
createCreates a Component.POST /{namespace}/componentsgetReturns one Component by id.GET /{namespace}/components/{id}listReturns Components, newest first, one page at a time.GET /{namespace}/componentsupdateChanges the given properties of a Component.PATCH /{namespace}/components/{id}deleteDeletes a Component; its history is kept.DELETE /{namespace}/components/{id}
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Component.create | Yes | Yes | Yes | No |
Component.get | Yes | Yes | Yes | Yes |
Component.list | Yes | Yes | Yes | Yes |
Component.update | Yes | Yes | Yes | No |
Component.delete | Yes | Yes | Yes | No |
Call it
Add a component to ShiftNote.Example
The pricing Page of a scheduling SaaS places a Pricing Component in its main region, fed by the published Offers. Publishing a $29 team Offer adds a column on every Page that uses the Component.