Export Suite — 6 components for importing, exporting, and printing editor content.
Provides dialogs and controls for document export (HTML, Markdown, PDF, DOCX, LaTeX, TXT), import (drag-and-drop file upload), print preview, template gallery, and page setup configuration.
Components
export_dialog/1— format selection radio buttons + Export actionprint_preview/1— page-sized white frame for print previewdownload_button/1— single-click download button with format iconimport_dialog/1— drag-and-drop zone + file input for importingtemplate_gallery/1— grid of document template cardspage_setup_dialog/1— page size, orientation, and margin controls
Summary
Functions
Renders a download button that triggers export for the given editor and format.
Renders an export dialog with format selection and an Export button.
Renders an import dialog with a drag-and-drop zone and file input.
Renders a page setup dialog with size, orientation, and margin controls.
Renders a page-sized white frame for print preview.
Renders a grid of document template cards.
Functions
Renders a download button that triggers export for the given editor and format.
Example
<.download_button editor_id="my-editor" format={:markdown} label="Download MD" />Attributes
editor_id(:string) (required)format(:atom) - Defaults to:html.label(:string) - Defaults to"Download".class(:string) - Defaults tonil.- Global attributes are accepted.
Renders an export dialog with format selection and an Export button.
Each format is displayed as a radio button. Fires phx-click="export:run"
with the selected format on export.
Example
<.export_dialog id="export" visible={@show_export} selected_format={@export_format} />Attributes
id(:string) (required)visible(:boolean) - Defaults tofalse.formats(:list) - Defaults to[:html, :markdown, :pdf, :docx, :latex, :txt].selected_format(:atom) - Defaults to:html.class(:string) - Defaults tonil.- Global attributes are accepted.
Renders an import dialog with a drag-and-drop zone and file input.
Accepts files of the types listed in :accepted_types. Fires
phx-click="import:file" when a file is selected.
Example
<.import_dialog id="import" visible={@show_import} />Attributes
id(:string) (required)visible(:boolean) - Defaults tofalse.accepted_types(:list) - Defaults to[".html", ".md", ".txt", ".docx"].class(:string) - Defaults tonil.- Global attributes are accepted.
Renders a page setup dialog with size, orientation, and margin controls.
Example
<.page_setup_dialog
id="page-setup"
visible={@show_page_setup}
page_size={@page_size}
orientation={@orientation}
margins={%{top: 1, bottom: 1, left: 1, right: 1}}
/>Attributes
id(:string) (required)visible(:boolean) - Defaults tofalse.page_size(:atom) - Defaults to:a4.orientation(:atom) - Defaults to:portrait. Must be one of:portrait, or:landscape.margins(:map) - Defaults to%{}.class(:string) - Defaults tonil.- Global attributes are accepted.
Renders a page-sized white frame for print preview.
The frame dimensions match the selected page size. Content is displayed inside with print-friendly margins.
Example
<.print_preview id="preview" content={@html_content} page_size={:letter} />Attributes
id(:string) (required)content(:string) - Defaults to"".page_size(:atom) - Defaults to:a4. Must be one of:a4,:letter, or:legal.class(:string) - Defaults tonil.- Global attributes are accepted.
Renders a grid of document template cards.
Each item in :templates should be a map with :name, :description,
:thumbnail (URL or nil), and :id keys.
Example
<.template_gallery id="tpl" templates={[
%{id: "blank", name: "Blank", description: "Empty document", thumbnail: nil},
%{id: "report", name: "Report", description: "Business report template", thumbnail: "/img/report.png"}
]} />Attributes
id(:string) (required)templates(:list) - Defaults to[].class(:string) - Defaults tonil.- Global attributes are accepted.