<scriptlang="ts"setup>import type { FileFormatType }from'~/models/fileFormat.js'functionhandleExport(filename: string,format: FileFormatType){alert(`Exporting ${filename} in ${format.toUpperCase()} format`)}</script><template><divclass="n-stack n-gap-m"><pclass="n-typescale-s"> This example demonstrates the basic usage of the ExportPopout component. It shows how to configure available export formats and handle export events.</p><div><nord-buttonid="export-button"aria-controls="export-popout"aria-haspopup="true"> Export<nord-iconslot="end"name="interface-download"/></nord-button></div><UiExportPopoutid="export-popout"@export="handleExport"/></div></template>
<scriptlang="ts"setup>import{ FileFormat, type FileFormatType }from'~/models/fileFormat.js'const formats =[FileFormat.CSV, FileFormat.Excel]const filename ='custom-export'functionhandleExport(filename: string,format: FileFormatType){alert(`Exporting ${filename} in ${format.toUpperCase()} format`)}</script><template><divclass="n-stack n-gap-m"><pclass="n-typescale-s"> This example shows how to customize the ExportPopout component with custom slots, controlled visibility, and custom positioning.</p><div><nord-buttonid="export-button"aria-controls="export-popout"aria-haspopup="true"> Download Report<nord-iconslot="end"name="interface-download"/></nord-button></div><UiExportPopoutid="export-popout"position="inline-end"anchor="export-button":formats:filename@export="handleExport"><template#header><divclass="n-stack-horizontal n-gap-s n-items-center"><h3class="n-font-size-m n-font-weight-active"> Export Custom Report</h3><nord-iconname="interface-download"size="s"/></div></template><template#csv><divclass="n-stack n-gap-s"><BaseButton@click="handleExport(filename, FileFormat.CSV)"> Download as CSV<nord-iconslot="end"name="interface-download"/></BaseButton><p> This is content included through a slot, specifically for the CSV format.</p><pclass="n-typescale-s"> CSV format is best for importing into spreadsheet software.</p></div></template><template#excel><divclass="n-stack n-gap-s"><BaseButton@click="handleExport(filename, FileFormat.Excel)"> Download as Excel<nord-iconslot="end"name="interface-download"/></BaseButton><p> This is content included through a slot, specifically for the Excel format.</p><pclass="n-typescale-s"> Excel format includes additional formatting and formulas.</p></div></template><template#description><divclass="n-stack n-gap-s"><pclass="n-typescale-s">Choose your preferred export format:</p><ulclass="n-typescale-s"><li>CSV - Simple, universal format</li><li>Excel - Rich formatting and calculations</li></ul></div></template></UiExportPopout></div></template>
Integration
This community asset is currently only available to use in the New Frontend for Provet Cloud.
Troubleshooting
If you experience any issues while using this community asset, please ask for support in the #vet-frontend Slack channel.
Edit page
TTherapyChoose therapy brandVVeterinaryChoose veterinary brandAbout Nord Design SystemGet support