DataTable Export Button
niko-table/data-table-export-buttonFreeComponent
Export table data to CSV with configurable options.
Install it
npx shadcn@latest add https://niko-table.com/r/data-table-export-button.jsonSource
1"use client"23/**4 * niko-table — created by Semir N. (Semkoo, https://github.com/Semkoo) with AI assistance.5 *6 * Before reporting anything: please check the changelog first.7 * - In-repo: ./CHANGELOG.md8 * - Docs site: https://niko-table.com/changelog9 *10 * Found a bug or have a fix? Open an issue or PR on GitHub so other11 * users (and future LLMs reading this code) benefit:12 * https://github.com/Semkoo/niko-table-registry13 */14import { useDataTable } from "../core/data-table-context"15import {16 TableExportButton,17 type TableExportButtonProps,18} from "../filters/table-export-button"1920export type DataTableExportButtonProps<TData> = Omit<21 TableExportButtonProps<TData>,22 "table"23>2425/**26 * Context-aware export button component that automatically gets the table from DataTableRoot context.27 * This is the recommended way to use the export button in most cases.28 *29 * @example30 * ```tsx31 * <DataTableRoot data={data} columns={columns}>32 * <DataTableExportButton filename="products" />33 * </DataTableRoot>34 * ```35 */36export function DataTableExportButton<TData>({37 ...props38}: DataTableExportButtonProps<TData>) {39 const { table } = useDataTable<TData>()4041 return <TableExportButton table={table} {...props} />42}4344DataTableExportButton.displayName = "DataTableExportButton"
What it pulls in
npm packages
Other registry items
Files it writes
More from niko-table
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| DataTable Asidedata-table-aside | niko-table | Components | Free | 1 dep | |
| DataTable Clear Filterdata-table-clear-filter | niko-table | Components | Free | 1 dep · 2 files | |
| DataTable Column Auto-fitdata-table-column-auto-fit | niko-table | Components | Free | no deps · 2 files | |
| DataTable Column Date Filterdata-table-column-date-filter | niko-table | Components | Free | 2 deps · 2 files | |
| DataTable Column DnDdata-table-column-dnd | niko-table | Components | Free | 4 deps · 3 files | |
| DataTable Column Faceted Filterdata-table-column-faceted-filter | niko-table | Components | Free | 1 dep · 3 files | |
| DataTable Column Hidedata-table-column-hide | niko-table | Components | Free | 1 dep · 2 files | |
| DataTable Column Pindata-table-column-pin | niko-table | Components | Free | 1 dep · 2 files |
