Skip to content

Accessibility and interaction

Semantics and reduced motion

Semantics(role=None, label=None, description=None, reading_order=None, hidden=False)
rolestr | NoneDefault: None

An ARIA-style role such as "graphics-symbol".

labelstr | NoneDefault: None

The short accessible name.

descriptionstr | NoneDefault: None

A longer description.

reading_orderint | NoneDefault: None

Rank for linear reading; lower comes first, unranked objects follow in scene order.

hiddenboolDefault: False

Mark a purely decorative object.

Per-node accessibility metadata: role, label, description, reading order and a flag for decorative objects.

AccessibilityInfo(
    title=None,
    description=None,
    alt_text=None,
    long_description=None,
    lang='en',
    reduced_motion=...,
)
titlestr | NoneDefault: None

The title of the animation.

descriptionstr | NoneDefault: None

A short description.

alt_textstr | NoneDefault: None

The short alternative for GIF and images.

long_descriptionstr | NoneDefault: None

The full text alternative.

langstrDefault: "en"

Language tag of the texts.

reduced_motionReducedMotionDefault: ...

What to show when the viewer asks for reduced motion.

Animation-level title, description, alternative texts, language and the reduced-motion policy.

ReducedMotion(mode='final', time=None)
modestrDefault: "final"

"final", "first" or "time".

timefloat | NoneDefault: None

Seconds into the animation; only valid with mode="time".

Chooses the representative still state that replaces autoplay when the viewer asks for reduced motion: the final state, the first state, or one explicit time.

ReducedMotion follows the web platform's prefers-reduced-motion preference {W3C} (2026). It is an authored alternative, not an automatic reduction in frame rate. Playback is still available when the viewer asks for it.

from kinetickit import AccessibilityInfo, ReducedMotion, Semantics

semantics = Semantics(role="graphics-symbol", label="Start", reading_order=1)
info = AccessibilityInfo(
    title="Reaching the goal",
    description="A dot travels to a target",
    long_description="A dot starts at the lower left and moves to the upper right.",
    reduced_motion=ReducedMotion("time", 1.0),
)

SVG and HTML keep titles, descriptions, stable object ids and per-node semantics. HTML adds keyboard-operable controls and an ordered object list. A GIF cannot carry these runtime semantics, so asking for accessibility output on a GIF needs a text description and can return a representative PNG.

Interaction

An interaction is data: it names an event on a node and the actions to run. KineticKit validates every binding against the node ids and the markers of the scene before it writes anything.

Event(*values)

A portable trigger: HOVER_ENTER, HOVER_LEAVE, CLICK, DBLCLICK, FOCUS, SELECT, DESELECT, CAMERA_CHANGE or PLAYBACK_END.

Binding(event, actions, target=None, required=False)

Connects one event to data-only actions, and says whether the interaction is required.

InteractionSpec(bindings=(), ranges=...)

The validated collection of bindings, plus the named time ranges that PlayRange can play.

from kinetickit.interaction import Binding, Event, InteractionSpec, PlayRange, Select, SetProperty

interactions = InteractionSpec(
    (
        Binding(Event.CLICK, (PlayRange("run"),), "a"),
        Binding(Event.CLICK, (Select(mode="toggle"), SetProperty(None, "opacity", 0.6)), "b"),
    ),
    {"run": (0.0, 2.0)},
)

PlayRange(name='')
namestrDefault: ''

Name of a range in InteractionSpec.ranges.

Action that plays a named time range.

Select(target=None, mode='toggle')
targetstr | NoneDefault: None

Node id, or None for the node that was hit.

modestrDefault: 'toggle'

"select", "deselect" or "toggle".

Action that selects, deselects or toggles a node.

SetProperty(target=None, property='opacity', value=1.0)
targetstr | NoneDefault: None

Node id, or None for the node that was hit.

propertystrDefault: 'opacity'

Property name.

valuefloat | boolDefault: 1.0

The new value.

Action that sets a property of a node, such as its opacity.

The actions are Play, Pause, Seek, PlayRange, Select, SetProperty, Toggle, SetSpeed, Reverse and ResetCamera. A binding with required=True fails before output when the chosen format cannot run it. An optional binding is dropped, and the manifest lists it under degraded. SVG and GIF drop interactions by policy; HTML runs them.

The interactive example combines both halves on a two-point scene.

Comments