Skip to content
API reference

components/generation-frame

Import
import * as api from "@fungi.computer/caps/components/generation-frame";
Kind Export Description
type alias GenerationStatus Where one generated piece of media is in its life.
type alias GenerationFrameProps Props accepted by GenerationFrame.
constant GenerationFrame One fixed frame for a generation, from queued to done: the frame keeps its size the whole time, so nothing around it moves. The finished media develops inside it (it sharpens out of a soft blur), and a failure dims the frame behind its message. Reduced motion keeps short fades only.

GenerationStatustype alias

Section titled “GenerationStatus”
Signature
type GenerationStatus =
"queued" | "generating" | "refining" | "done" | "failed";

Where one generated piece of media is in its life.


GenerationFramePropstype alias

Section titled “GenerationFrameProps”
Signature
type GenerationFrameProps = object &
Omit<HTMLAttributes<HTMLDivElement>, "children">;

Props accepted by GenerationFrame.

Name Type Description
status GenerationStatus -
children? ReactNode The finished media (or, while refining, a rough preview of it).
aspectRatio? number Width over height. Omit when the parent already sizes the frame.
label? ReactNode What is happening, for people using a screen reader.
indicator? ReactNode The working indicator; Caps’ bloom loader by default.
failure? ReactNode Shown over the dimmed frame when generation fails.

GenerationFrameconstant

Section titled “GenerationFrame”
Signature
const GenerationFrame: ForwardRefExoticComponent<
object &
Omit<HTMLAttributes<HTMLDivElement>, "children"> &
RefAttributes<HTMLDivElement>
>;

One fixed frame for a generation, from queued to done: the frame keeps its size the whole time, so nothing around it moves. The finished media develops inside it (it sharpens out of a soft blur), and a failure dims the frame behind its message. Reduced motion keeps short fades only.