Guide

Syntax

Author ArrowJS widgets with ```arrow fenced blocks, optional ```arrow-css styles, or ::arrow bound directives — both forms emit the same AST node.

Arrow widgets accept two authoring forms. Both emit the same ['ArrowSandbox', attrs] AST node.

Write a fenced arrow block

Use a ```arrow fence for inline widget source. Fence attributes (for example height) pass through to the renderer:

widget.md
```arrow {height="120px"}
const state = reactive({ count: 0 })

export default html`
  <button @click="${() => state.count++}">
    Clicked ${() => state.count}
  </button>
`
```

Add adjacent CSS

Optional adjacent ```arrow-css supplies main.css for the sandbox:

widget-with-css.md
```arrow {height="120px"}
const state = reactive({ count: 0 })

export default html`
  <button @click="${() => state.count++}">
    Clicked ${() => state.count}
  </button>
`
```

```arrow-css
button { font: inherit; padding: 0.5rem 1rem; }
```

Bind a directive to host data

Use ::arrow when the widget source lives in host data instead of the markdown body:

directive.md
::arrow{:source="widgets.reorderCalculator"}
::

The source attribute resolves against your Comark binding roots (for example data.widgets.reorderCalculator). Fenced blocks and bound directives produce identical AST output — pick the form that fits your authoring model.

Copyright © 2026