Documentation Index
Fetch the complete documentation index at: https://mintlify.com/andresilva-cc/grafex/llms.txt
Use this file to discover all available pages before exploring further.
RenderOptions is the options object accepted by the render() and renderAll() library functions. Every field is optional — omit any field you want to inherit from the composition’s config export instead. Options passed here take the highest precedence in the merge chain, overriding both the base CompositionConfig and any matched VariantConfig.
Interface
Fields
Props to pass to the composition’s default-export component. These are shallow-merged with any
props defined in the matching VariantConfig — RenderOptions props override variant props for any overlapping keys. Keys present only in the variant props are preserved.Override the composition viewport width in logical pixels. Supersedes
width defined in CompositionConfig or the matched VariantConfig. The physical output width equals width × scale.Override the composition viewport height in logical pixels. Supersedes
height defined in CompositionConfig or the matched VariantConfig. The physical output height equals height × scale.Device pixel ratio to apply to the viewport. A value of
2 produces high-DPI (retina) output: the layout still sees the logical width × height viewport, but the exported image contains width × scale by height × scale physical pixels.Output image format.
'png' is lossless and supports transparency. 'jpeg' is lossy but produces smaller files — useful for photographs or gradient-heavy backgrounds where pixel-perfect fidelity is not required.JPEG compression quality from
1 (lowest quality, smallest file) to 100 (highest quality, largest file). Only applied when format is 'jpeg'. This field has no effect on PNG output.Setting
quality without also setting format: 'jpeg' has no effect. The default format is 'png', which ignores this option.Browser engine used for rendering. WebKit is installed automatically when you
npm install grafex and is the default. Chromium is an alternative if you encounter CSS compatibility issues — it must be installed separately before use.Name of a single variant to render from the composition’s
config.variants map. When provided, Grafex merges the named VariantConfig with the base CompositionConfig before applying the remaining RenderOptions. When omitted, the base config is used directly without any variant merge.The
variant field is not available on renderAll(). That function renders every variant defined in config.variants and accepts Omit<RenderOptions, 'variant'> — the variant key is excluded from its options type.