Skip to content

API Reference / @gtkx/components / TypedStatefulActionProps

Type Alias: TypedStatefulActionProps<S> ​

TypedStatefulActionProps<S> = StatefulActionBaseProps & object

Defined in: packages/components/src/types.ts:368

Props of a StatefulAction whose state has the GVariant type stateType.

Type Parameters ​

S ​

S extends string

Type Declaration ​

onStateChange? ​

optional onStateChange?: ((state) => void) | null

Called with the state a menu item, a button or an activation requests; render it as state to accept it.

state ​

state: VariantInput<S>

State the action reports, in the JavaScript shape of stateType.

stateType ​

stateType: S

GVariant type string of the state, such as "i" or "as"; it cannot change while the action is rendered.