captions.js
API ReferenceFunctions

getPreset()

Predefined caption appearance presets and their strong typings.

Predefined caption appearance presets and their strong typings.

Call Signature

function getPreset(name): StylePreset;

Looks up a built-in preset by name.

Parameters

ParameterType
nameStylePresetName

Returns

StylePreset

Remarks

Matching is case-insensitive and treats spaces, - and _ the same, so "focus-box" resolves to "Focus Box" (handy for CLI flags).

Example

const preset = getPreset("Karaoke");

Throws

Error listing the available names when nothing matches.

Call Signature

function getPreset(name): StylePreset;

Looks up a built-in preset by name.

Parameters

ParameterType
namestring

Returns

StylePreset

Remarks

Matching is case-insensitive and treats spaces, - and _ the same, so "focus-box" resolves to "Focus Box" (handy for CLI flags).

Example

const preset = getPreset("Karaoke");

Throws

Error listing the available names when nothing matches.

For AI agents and LLMs: this page as Markdown · llms.txt · all docs in one file