Skip to content

Enums reference

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

from inkflow import (
    Align, ColorMode, Direction, Easing, MediaAlign, MediaFit, Muted, 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(...).

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 and the anim-from-* modifier class suffix.

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)").

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").