# `PhiaUi.Components.Editor.Export`
[🔗](https://github.com/charlenopires/PhiaUI/blob/v0.1.17/lib/phia_ui/components/editor/export.ex#L1)

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 action
- `print_preview/1`     — page-sized white frame for print preview
- `download_button/1`   — single-click download button with format icon
- `import_dialog/1`     — drag-and-drop zone + file input for importing
- `template_gallery/1`  — grid of document template cards
- `page_setup_dialog/1` — page size, orientation, and margin controls

# `download_button`

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 to `nil`.
* Global attributes are accepted.

# `export_dialog`

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 to `false`.
* `formats` (`:list`) - Defaults to `[:html, :markdown, :pdf, :docx, :latex, :txt]`.
* `selected_format` (`:atom`) - Defaults to `:html`.
* `class` (`:string`) - Defaults to `nil`.
* Global attributes are accepted.

# `import_dialog`

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 to `false`.
* `accepted_types` (`:list`) - Defaults to `[".html", ".md", ".txt", ".docx"]`.
* `class` (`:string`) - Defaults to `nil`.
* Global attributes are accepted.

# `page_setup_dialog`

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 to `false`.
* `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 to `nil`.
* Global attributes are accepted.

# `print_preview`

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 to `nil`.
* Global attributes are accepted.

# `template_gallery`

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 to `nil`.
* Global attributes are accepted.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
