Exporting Existing Entries

Learn how to implement functionality for exporting data for later use.

In this lesson, we're going to take a look into how we can implement an export functionality that we can use to export data for later use. We're going to use the same component for two different purposes: exporting all students or exporting a single student. First, let's take a look at the example below where we added a new Export component to our Header and Table.

@tailwind base;
@tailwind components;
@tailwind utilities;
Add the Export component

Notice that when we reference the Export component inside the Header, we also pass a student prop, whereas in Table.svelte, we don't pass anything. Based on the presence of the prop, we can decide whether to export all students or just a single student.

Currently, the Export component is empty. Try to create a primary button where the ...