The csv component

A button that lets the user download data as a CSV file. Each column from the items in the component will map to a column in the resulting CSV.

Top-level parameters

title

REQUIRED. The text displayed on the download button.

bom

Whether to include a Byte Order Mark (a special character indicating the character encoding) at the beginning of the file. This is useful for Excel compatibility.

class

class attribute added to the container in HTML. It can be used to apply custom styling to this item through css. Added in v0.18.0.

color

Color of the button

filename

The name of the file that should be downloaded (without the extension).

icon

Name of the icon (from tabler-icons.io) to display in the button.

id

id attribute added to the container in HTML. It can be used to target this item through css or for scrolling to this item through links (use "#id" in link url).

separator

How individual values should be separated in the CSV. "," by default, set it to "\t" for tab-separated values.

size

The size of the button (e.g., sm, lg).

Example 1

CSV download button

select 
    'csv'              as component,
    'Download my data' as title,
    'people'           as filename,
    'file-download'    as icon,
    'green'            as color,
    ';'                as separator,
    TRUE               as bom;
select 
    'Ophir'   as Forename,
    'Lojkine' as Surname,
    'lovasoa' as Pseudonym;
select 
    'Linus'    as Forename,
    'Torvalds' as Surname,
    'torvalds' as Pseudonym;

Result

See also: other components