Skip to content

Enums reference

Shared value types used across Inkflow. All are imported from the top-level inkflow package:

from inkflow import (
    Align,
    AnimationKind,
    ColorMode,
    Direction,
    Easing,
    MediaAlign,
    MediaFit,
    Muted,
    Trigger,
    VAlign,
)

Most are fixed sets of choices. Easing also accepts custom curves, so alongside its named presets (Easing.EASE_IN_OUT) it offers Easing.cubic_bezier(...) and Easing.raw(...). Trigger follows the same value-object shape: presets (Trigger.ON_CLICK, Trigger.WITH_PREVIOUS, Trigger.AFTER_PREVIOUS) plus a Trigger.at(n) constructor to pin an absolute step.

Direction

Bases: _KebabStrEnum

Direction for animations and transitions that move along an axis.

Used by SlideIn, SlideOut, Push, Cover, and Wipe. The member value ("left", "right", …) is the wire value sent to the presenter; for slide animations it resolves to the cue's from-x/from-y offset.

ATTRIBUTE DESCRIPTION
LEFT

Leftward.

RIGHT

Rightward.

UP

Upward.

DOWN

Downward.

Easing

Bases: str

A CSS easing curve for animations and transitions.

Use a named preset for the common curves, or build a custom one with cubic_bezier or raw.

FadeIn("#a", easing=Easing.EASE_IN_OUT)
SlideIn("#a", easing=Easing.cubic_bezier(0.2, 0, 0.3, 1))
Highlight("#a", easing=Easing.raw("steps(4, end)"))
ATTRIBUTE DESCRIPTION
EASE

The CSS ease curve (slow start, fast middle, slow end).

TYPE: Easing

EASE_IN

The CSS ease-in curve (slow start).

TYPE: Easing

EASE_OUT

The CSS ease-out curve (slow end).

TYPE: Easing

EASE_IN_OUT

The CSS ease-in-out curve (slow start and end).

TYPE: Easing

LINEAR

The CSS linear curve (constant rate).

TYPE: Easing

STEP_START

The CSS step-start curve (jump to the end state immediately).

TYPE: Easing

STEP_END

The CSS step-end curve (hold, then jump at the end).

TYPE: Easing

cubic_bezier classmethod

cubic_bezier(
    x1: float, y1: float, x2: float, y2: float
) -> Easing

A custom cubic-bézier curve as an Easing (the CSS function string).

raw classmethod

raw(css: str) -> Easing

Any CSS easing string verbatim, e.g. Easing.raw("steps(4, end)").

Trigger

Bases: str

When a cue fires. You set the intent; step numbers are inferred.

FadeIn("headline")                          # on the next keypress
FadeIn("subtitle", Trigger.WITH_PREVIOUS)   # with the previous cue
FadeIn("caption", Trigger.AFTER_PREVIOUS)   # automatically, once it finishes
FadeIn("arrow", Trigger.at(3))              # pinned to step 3

Markdown reveals accept the same values via trigger= (::step trigger=with-previous::, ::step trigger=after-previous::, ::step trigger=3::).

ATTRIBUTE DESCRIPTION
ON_CLICK

The default: the cue fires on the next keypress.

TYPE: Trigger

WITH_PREVIOUS

Fire together with the previous cue. When it comes first, the element is

TYPE: Trigger

AFTER_PREVIOUS

Fire automatically once the previous cue finishes.

TYPE: Trigger

explicit_step

The step for a Trigger.at(...) value, or None for a preset.

TYPE: int | None

at classmethod

at(step: int) -> Trigger

Pin the cue to an absolute step number.

AnimationKind

Bases: _KebabStrEnum

The role an animation plays in an element's lifecycle.

Determines how the step engine composes several cues on one element: enters reveal, exits hide, and emphasis fires momentarily without changing whether the element is shown. The step engine keeps at most one enter/exit governing an element's visibility at a time, so an element can enter, be emphasized, and exit at different steps, and can even re-enter after an exit.

Set on the semantic base classes (animations.Enter/Exit/Emphasis); concrete types inherit it, so authors pick a kind by which base they subclass.

ATTRIBUTE DESCRIPTION
ENTER

Reveals the element; it is hidden before this cue's step and shown after.

EXIT

Hides the element; it is shown before this cue's step and hidden after.

EMPHASIS

A momentary accent (e.g. a pulse) that leaves visibility unchanged. Plays only

Align

Bases: _KebabStrEnum

Horizontal text alignment for a TextBox or Markdown zone.

ATTRIBUTE DESCRIPTION
LEFT

Left-aligned (the default when no override is set).

CENTER

Centered.

RIGHT

Right-aligned.

JUSTIFY

Justified.

VAlign

Bases: StrEnum

Vertical alignment of the content block inside a zone.

ATTRIBUTE DESCRIPTION
TOP

Anchored to the top of the zone (the default when no override is set).

CENTER

Centered vertically.

BOTTOM

Anchored to the bottom of the zone.

MediaFit

Bases: _KebabStrEnum

CSS object-fit preset for a Media asset.

The member value is the literal object-fit value emitted into the style.

ATTRIBUTE DESCRIPTION
CONTAIN

Scale to fit inside the zone, preserving aspect ratio (contain).

COVER

Fill the zone, cropping overflow, preserving aspect ratio (cover).

FILL

Stretch to fill the zone, ignoring aspect ratio (fill).

NONE

Keep intrinsic size, no scaling (none).

SCALE_DOWN

The smaller of none and contain (scale-down).

MediaAlign

Bases: _KebabStrEnum

object-position preset for a Media asset.

Each member maps to an (x, y) percentage pair via position, used to build the object-position declaration.

ATTRIBUTE DESCRIPTION
CENTER

Centered (50% 50%).

TOP

Top edge, horizontally centered (50% 0%).

BOTTOM

Bottom edge, horizontally centered (50% 100%).

LEFT

Left edge, vertically centered (0% 50%).

RIGHT

Right edge, vertically centered (100% 50%).

TOP_LEFT

Top-left corner (0% 0%).

TOP_RIGHT

Top-right corner (100% 0%).

BOTTOM_LEFT

Bottom-left corner (0% 100%).

BOTTOM_RIGHT

Bottom-right corner (100% 100%).

position

The object-position percentage pair (x, y) for this alignment.

TYPE: tuple[int, int]

Muted

Bases: Enum

Audio muting policy for a Video.

Unlike the other enums here this never becomes a CSS/HTML value; it is resolved in Python to whether the <video> gets a muted attribute, so it is a plain Enum, not a _KebabStrEnum.

ATTRIBUTE DESCRIPTION
AUTO

Muted iff the video autoplays. Sidesteps the browser's autoplay block

ON

Always muted.

OFF

Always unmuted. Explicit opt-in: an autoplaying clip may be blocked by the

ColorMode

Bases: StrEnum

Color mode for the presentation. Sets the data-theme attribute on <html>, which selects the active theme CSS.

ATTRIBUTE DESCRIPTION
DARK

Dark theme (data-theme="").

LIGHT

Light theme (data-theme="light").