Interface: ActionsComponent
Defined in: packages/core/src/passages/story/types.ts:518
Component for displaying a group of interactive action buttons. Used to present player choices, navigation options, or any interactive decisions.
Example
// Horizontal action buttons (default)
{
type: 'actions',
content: [
{ label: 'Go North', action: () => Game.jumpTo('north-room') },
{ label: 'Go South', action: () => Game.jumpTo('south-room') }
]
}
// Vertical layout for dialogue choices
{
type: 'actions',
props: { direction: 'vertical' },
content: [
{ label: 'Tell the truth', action: () => increaseHonesty() },
{ label: 'Lie', action: () => decreaseHonesty() },
{ label: 'Say nothing', action: () => Game.jumpTo('silence') }
]
}
Extends
BaseComponent
Properties
content
content:
ActionType[]
Defined in: packages/core/src/passages/story/types.ts:528
Array of action buttons to display. Each action represents a choice or interactive option for the player.
id?
optionalid:string
Defined in: packages/core/src/passages/story/types.ts:19
Optional unique identifier for this component. Can be used to reference or manipulate specific components programmatically.
Example
{ type: 'text', id: 'intro-text', content: 'Welcome!' }
Inherited from
BaseComponent.id
initialVariant?
optionalinitialVariant:"hidden"|"display"|"disclosure"
Defined in: packages/core/src/passages/story/types.ts:34
Controls the initial visibility state of the component.
Remarks
This property is designed for future UI implementation to support dynamic component visibility. Currently defined but not yet implemented in the UI layer.
"display"- Component is visible and rendered immediately (default behavior)"hidden"- Component exists but is not visible initially"disclosure"- Component is initially collapsed/hidden but can be expanded by user interaction
Default Value
"display"
Inherited from
BaseComponent.initialVariant
props?
optionalprops:object
Defined in: packages/core/src/passages/story/types.ts:533
Optional configuration for layout and styling.
className?
optionalclassName:string
CSS class name(s) to apply to the actions container.
Example
props: { className: 'gap-4 p-4' }
direction?
optionaldirection:"horizontal"|"vertical"
Layout direction for the action buttons.
Default Value
"horizontal"
Remarks
"horizontal"- Buttons arranged in a row (wraps on small screens)"vertical"- Buttons stacked in a column (better for many options or long labels)
type
type:
"actions"
Defined in: packages/core/src/passages/story/types.ts:522
Discriminator property identifying this as an actions component.