Rendro.Fragmentable protocol (Rendro v0.2.0)

Copy Markdown View Source

Protocol for splitting layout components across page boundaries.

Summary

Types

t()

All the types that implement this protocol.

Functions

Splits a component given the available height on the current page. Returns {fitting_component, remaining_component}. If the component fits entirely, returns {component, nil}. If it cannot be split to fit, returns {nil, component}.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

split(component, available_height)

@spec split(t(), number()) :: {t() | nil, t() | nil}

Splits a component given the available height on the current page. Returns {fitting_component, remaining_component}. If the component fits entirely, returns {component, nil}. If it cannot be split to fit, returns {nil, component}.