Basic example
```
const data = [
['firstname', 'lastname', 'email'] ,
['Ahmed', 'Tomi' , 'ah@smthing.co.com'] ,
['Raed', 'Labes' , 'rl@smthing.co.com'] ,
['Yezzi','Min l3b', 'ymin@cocococo.com']
];
Click here to download CSV file
```
Set **data props** as "Array of literal (json) objects" ;
```
const data = [
{firstname: 'Ahmed', lastname: 'Tomi' , email: 'ah@smthing.co.com'},
{firstname:'Raed', lastname:'Labes' , email:'rl@smthing.co.com'} ,
{firstname:'Yezzi', lastname:'Min l3b', email:'ymin@cocococo.com'}
];
Click here to download CSV file
```
Add styling to your link via **style props** or **className props** :
```example
const prettyLink = {
backgroundColor: '#8dc63f',
fontSize: 14,
fontWeight: 500,
height: 52,
padding: '0 48px',
borderRadius: 5,
color: '#fff'
};
const data = [
['firstname', 'lastname', 'email'] ,
['Ahmed', 'Tomi' , 'ah@smthing.co.com'] ,
['Raed', 'Labes' , 'rl@smthing.co.com'] ,
['Yezzi','Min l3b', 'ymin@cocococo.com']
];
Download CSV β¬ to download CSV
```
Set the separator between cells via **separator props**:
```example
const data = [
['firstname', 'lastname', 'email'] ,
['Ahmed', 'Tomi' , 'ah@smthing.co.com'] ,
['Raed', 'Labes' , 'rl@smthing.co.com'] ,
['Yezzi','Min l3b', 'ymin@cocococo.com']
];
Download CSV β¬
```
Set the default **filename** of the downloaded CSV file :
```
const randomData = Array.from({length:10}, (v, k) =>
Array.from({length:4}, (vv, kk) => Math.random().toString(36).substring(7))
);
// -----------------------Double click hereππΌ to change the name (it is editable)
Download me with another name
```
Add **headers** :
```
//It is editable content : you can change code and see results on live.
const randomData = Array.from({length:10}, (v, k) =>
Array.from({length:4}, (vv, kk) => Math.random().toString(36).substring(5))
);
const headers =['Rando-π', 'Rando-π', 'Rando-πΊ', 'Rando-π'];
Download with Headers
```