knighn export

Export a Knighn design (.html) to PNG, JPG, PDF, .fig, .pen, SVG or Expo SwiftUI code, or a document to PNG, JPG, WEBP, SVG, PDF, PPTX, JSX, HTML or .fig.

knighn export [options] [FILE]
Argument What it is
FILE A Knighn design (.html), or a .fig or .pen file.
Option What it does Default
-o, --output <output> Output file path. <name>.<format>
-f, --format <format> Export format: png, jpg, webp, svg, pdf, pptx, jsx, html, fig, expo. from the output extension, else png
-s, --scale <scale> Export scale. 1
-q, --quality <quality> Quality 0-100 for JPG/WEBP. 90
--page <page> Export a specific page by name (FIG defaults to the whole document)
--node <node> Export a specific node by ID (cannot be combined with --page)
--style <style> JSX style: knighn or tailwind. knighn
--html <html> HTML output mode: fragment or standalone. fragment
--css <css> HTML CSS output: inline or tailwind. inline
--assets <assets> HTML asset output: inline or external. inline
--fonts <fonts> HTML font output: assets or none. none
--frame <frame> Knighn designs: frames to export, comma separated (name, page/name or route)
--json Knighn designs: print the written files as JSON.
--thumbnail Export page thumbnail instead of full render.
--width <width> Thumbnail width. 1920
--height <height> Thumbnail height. 1080

Examples

Export the design as a PNG:

knighn export designs/circle-text.html -f png
✓ Exported 1 file as PNG
[0] Page-1-DomeSticker.png
    frame: #/Page 1/DomeSticker
    size: 54.8 KB