Skip to content

Control Flow & Navigation

import { Tabs, TabItem, Aside } from '@astrojs/starlight/components';


[if exp="f.score >= 100"]
You achieved a perfect score!
[elsif exp="f.score >= 50"]
Not bad — keep going!
[else]
Better luck next time.
[endif]

exp= is a Rhai expression evaluated to a boolean. Truthy rules:

TypeFalsy when…
boolfalse
int0
stringempty string ""
other typesunit value

Skips everything between [ignore] and [endignore] when exp= is truthy. Use this to comment out large blocks conditionally:

[ignore exp="sf.debug == false"]
[trace exp="f.current_scene"]
[endignore]

Unconditionally jump to a label. storage= changes the current file; target= names the label (include the * prefix).

[jump target=*game_over]
[jump storage=scene02.ks target=*start]

Accumulate one or more choice buttons. Each [link] tag defines one option.

[link target=*choice_a]
Option A
[link target=*choice_b]
Option B
[endlink]

Attributes:

AttributeTypeDescription
storage=stringTarget scenario file
target=stringTarget label
text=stringButton label text (alternative to inline text)

Same semantics as [link] but intended for an image-based button rather than a text span.