You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,7 +22,7 @@ Notice how handlers are bound to the cell from the input schema _in_ the VDOM de
22
22
23
23
(For even more detail, see `HANDLERS.md`)
24
24
25
-
# Bidirectional Binding with $ Prefix
25
+
##Bidirectional Binding with $ Prefix
26
26
27
27
Many CommonTools components support **bidirectional binding** through the `$` prefix. This powerful feature automatically updates cells when users interact with components, eliminating the need for explicit onChange handlers in most cases.
Both inputs update the cell, but the second one logs changes. Use the simple bidirectional binding unless you need the extra logic.
277
278
278
-
# ct-select
279
+
## ct-select
279
280
280
281
The `ct-select` component creates a dropdown selector. **Important:** It uses an `items` attribute with an array of `{label, value}` objects, **not** HTML `<option>` elements.
@@ -363,7 +364,7 @@ The `value` property doesn't have to be a string - it can be any type:
363
364
364
365
Like other components, `ct-select` supports bidirectional binding with the `$value` prefix, automatically updating the cell when the user selects an option.
365
366
366
-
# ct-list
367
+
## ct-list
367
368
368
369
The `ct-list` component provides a convenient way to display and manage lists, but it has **specific schema requirements**.
- Your items only need `title` and optionally `done`
422
424
- You want a quick, pre-styled list component
423
425
- You don't need custom rendering
424
426
425
427
**Use manual rendering when:**
428
+
426
429
- You have custom fields
427
430
- You need custom styling or layout
428
431
- You need fine-grained control over interactions
429
432
430
-
# ct-message-input
433
+
## ct-message-input
431
434
432
435
This component bundles an input and a button to 'send a message' or 'add an item to a list' which is a common pattern. You don't need to worry about the value until submission time.
433
436
@@ -449,7 +452,7 @@ const addItem = handler<
449
452
/>
450
453
````
451
454
452
-
# ct-outliner
455
+
## ct-outliner
453
456
454
457
`ct-outliner` is conceptually similar to `ct-list` except it works on a tree data structure. Below is a demonstration of the minimal use, see `page.tsx` for a more complete example.
The `ct-render` component displays pattern instances within another pattern. Use this for **pattern composition** - combining multiple patterns together in a single recipe.
- **Direct interpolation** (`{counter}`): Simple cases, most concise
623
628
- **JSX component syntax** (`<Counter />`): When you want it to look like a component
624
629
- **ct-render** (`<ct-render$cell={counter} />`): When the pattern wasn't instantiated from within this pattern but was passed in or was stored in a list.
0 commit comments