Skip to content

Frame Directive

Creates a Frame and initializes the contents with the passage specified.

x-frame="passage name"

Like the passage directive, you can pass anything that resolves to a valid passage name.

<div x-frame="'passage name'">
</div>
The passage passed to x-frame will be rendered on frame initialization, unless another passage is already pressent in the State

Tip

Frames get initialized per element, not per name. Meaning each time an element with x-frame appears on the screen, that element will be initialized. In the future, it will be possible to configure default behavior per-name using the Config API.

x-frame:name

All x-frame directives reference the unnamed frame by default. To use a different frame, pass its name as the value.

<div x-frame:menu="'Inventory Menu'">
</div>
This assigns the parent div to a frame called "menu".

Modifiers

The following modifiers are available for the x-frame directive.

overwrite

Makes the default passage always render upon frame initialization, ignoring any current state.