Tailwind CSS Best Practices for a CSV Export Card
Design one durable export card with honest progress, a clear download action and a useful retry path.
Give each export a persistent card. Show a named stage or a measured count, announce changes without taking focus, and keep the download or retry action close to the job it affects.
Apply Tailwind CSS best practices to an export by building one persistent card per job. Give the card a stable title and one visible status sentence, then show the action that the current state permits. Use a percentage only when you can measure advancement. Reserve Download for the point at which the file can actually be fetched, and keep recovery instructions beside the export if it fails.
Take Harth, a fictional inventory app. Its users export filtered stock records as CSV and often continue working while the server assembles the file. The same card must make sense at the end of a long wait, after the original request has been accepted, and after the person returns to the screen. The examples below use Tailwind CSS v4 for presentation and ordinary HTML semantics for the controls.
Keep one card for each export
Use a heading such as “North warehouse inventory” and a separate line with the format and the scope captured when the job started. Under that, place the state and the action. The scope stays fixed when someone changes the filters for the next export, so a link for North warehouse cannot appear to belong to the newly selected South warehouse.

Define three review specimens: “Preparing CSV” with no download action, “CSV ready” with a Download CSV link, and “Export failed” with a Try again button when the failure is recoverable. Leave room for supporting copy in all three. For a queued job, “Waiting to start” is more accurate than “Preparing CSV.” Keep that distinction if waiting can last long enough for a user to wonder whether the request was accepted.
| Evidence from the job | What the card shows | Available action |
|---|---|---|
| Job accepted, file still in progress | Preparing CSV | Read current status |
| File available to this user | CSV ready | Download CSV |
| Job stopped, retry permitted | Export failed, filters saved | Try again |
When several jobs appear in one list, keep each outcome tied to its own heading and provide a distinguishing accessible name for actions that otherwise repeat. “Download North warehouse inventory CSV” is more useful in a screen reader’s link list than three identical “Download” links. If there are two North warehouse files, distinguish the exports by their displayed time. The visible action text can remain short as long as it is included in its accessible name.
Apply the same thinking to pending clicks. Before a request is acknowledged, show “Sending request” near the start control and prevent accidental reactivation. Give the application a way to confirm whether the server accepted the request if the connection drops. Without that check, a second click can start a second export while the interface still shows only one. When the request is acknowledged, render the resulting job from its durable identifier.
Use different visual treatments for different purposes. A surface or badge can help someone scan a list, while the sentence carries the actual outcome. The W3C’s guidance on use of color explains why green, amber and red need another way to communicate meaning. Test the states with the colored marker hidden. If someone cannot identify the failed card by reading it, revise the copy before tuning the palette.
Confirm the request briefly
Use the EmviUI alert and toast specimens to review the brief acknowledgment you may show when a request is accepted. The specimen repeats its title across light and saturated surfaces. In Harth, give the acknowledgment specific copy such as “North warehouse export requested.” Keep the lasting result in the job card so a person returning after the acknowledgment disappears can still find the outcome.

Show progress you can measure
Look at the determinate bar in EmviUI’s Figma progress component. The visible value can sit before, above or after the track. Borrow the track and label placement to explore the card at a narrow width, then decide separately which values the export service can report. The depicted percentages are design examples.

Suppose the service reports that 240 of 400 records have been read. The card can show “Reading records · 240 of 400” with a bar at 60%. This measures the reading stage. If building and storing the CSV take additional time, keep the card in a working state after all 400 have been read. Change the sentence to “Building CSV,” and use an indeterminate indicator if that stage has no measurable total.
The HTML standard for the progress element distinguishes progress with a current value from an indeterminate task. Give the element a label and pass a meaningful maximum and current value for measured work. Omit the value attribute when the amount completed is unknown. A value of zero describes a measurement at its start and has a different meaning from an unknown value.
<label for="reading-stock">Reading inventory records</label>
<progress id="reading-stock" class="block w-full"
value="240" max="400">240 of 400</progress>
If the service changes its counting method after it starts, consider showing the verified phase without a number until the total stabilizes. For example, a count of rows read from a database is hard to interpret if the product later removes duplicates and the UI presents the same count as rows in the completed file. Label the unit users can understand and use the same unit on both sides of the comparison.
Review the Figma specimen with actual copy and both kinds of progress. In the working card, leave a stable line for the phase so removing the bar at completion does not also remove the explanation. If you animate an indeterminate treatment, make sure the visible message still describes what is happening when that animation is disabled. Browser and assistive-technology behavior should be checked in the implemented component.
Announce changes that affect the task
Keep a status region mounted before you update it. When a job the person started reaches a meaningful change, update that region with a sentence that identifies the job and outcome, such as “North warehouse CSV is ready to download.” Leave the actual link in the visible export card. A person working elsewhere on the page can hear the update and choose when to return.

W3C’s status message guidance describes updates that should be available to assistive technology without receiving focus. The ARIA22 technique demonstrates a polite status region. Put the announcement text in that region and test the transition with focus still on a separate control. Moving focus to each completed job can interrupt the task the user started during the wait.
If the UI polls for progress, keep the visible count current and publish fewer announcements. A reasonable policy for Harth is to announce that an export has started, that it is available, or that it has failed. If the inventory screen restores six completed jobs on page load, show all six cards without announcing a new completion for each one. Distinguish restored data from changes observed after the current view opened.
Verify the same transition with two jobs running. When South warehouse finishes first, the announcement should name South warehouse even when North warehouse is at the top of the list. Keeping the status region at the list level gives you one place to decide which update to announce. If completions arrive close together, test how the chosen screen reader handles that burst and consider a grouped message that preserves the necessary context.
For keyboard review, follow the focus indicator during failure and retry. If activating Try again causes that button to disappear, keep a predictable next focus location and test where the browser actually goes. On background completion, leave focus where it was. Test the download link and the retry button as their respective HTML elements. The guide to focus and status styles offers a follow-up check for combining surface, text and focus treatments on the resulting controls.
Keep the action visible at narrow widths
Let the title, outcome and action stack at narrow widths. When the card is wide enough, let the action sit next to the text block. Use Tailwind’s responsive utilities with a card-level container if the same component appears in a dashboard column and a full-width history page. A wide viewport can still leave the card with very little space.

For a Tailwind v4 example, mark the outer wrapper with @container. Give the inner layout flex flex-col gap-3 @md:flex-row @md:items-start, and allow the copy block to take up remaining space with min-w-0 flex-1. Let the title wrap and use a readable action label at the smallest width. Confirm the configured @md container threshold in the built CSS. A changed design theme may set a different threshold from the default.
Put the title, state text and action in document order. When there is little room, a button placed underneath still belongs to the text directly above it. With several jobs, long filenames and translations can make a short test fixture look misleadingly tidy. Use a longer title, a retry reason of two lines, and the same record in both layout widths before accepting the component.
The W3C’s reflow guidance gives the 320 CSS pixel reference for vertically scrolling content. At that width, confirm that you can read the entire outcome, locate the corresponding action and activate it without horizontal scrolling. Try it after loading the real page shell. Its padding, sticky bars and side panels can change the space available to the card compared with a stand-alone preview.
Keep state styling as complete class strings. Tailwind’s source detection documentation explains how it scans files for complete class names. Use a finite presentation map, for example a ready state with bg-emerald-50 text-emerald-900 and a recoverable failure with bg-orange-50 text-orange-900. Select the whole string from the known state. Verify that the production stylesheet contains its rules, and check contrast against the actual theme colors.
Review a failed export from start to finish
Run a test that starts with filters set to North warehouse and status set to In stock. Simulate an export that stops during file assembly. The failure should explain that the CSV could not be created and that the original filters are available for retry. Before retrying, change the filter panel to South warehouse. Press Try again on the North warehouse card and confirm that the submitted scope comes from the earlier job.

Run a second check in which the user comes back to a ready export after its file expires. Change the state to “File expired” once expiry is known. A regeneration action can use the captured filters if authorization and the data are still available. Describe it as a new export when it will reflect current stock rather than recreate an old snapshot.
Record the state received from the service, the exact text shown, the link or button present, and what the screen reader announced. Include an unknown or outdated service state in this review. A neutral “Can’t confirm export status” with a way to check again gives people a next step while avoiding a false failure or success. For related patterns that retain context after an action fails, see the CRM contact workflow example.
Exercise a partial failure if the service can produce incomplete files. Suppose a report omits ten records that could not be read. Decide with the product team whether such a file can be offered at all. If it can, name the result “CSV available with omissions” and show the number of skipped records alongside the link. Add a way to understand which records were skipped if people need that detail to reconcile stock. Treat a full success and a partial result as separate test cases.
Choose an agreed test account and a small set of synthetic inventory records. Capture the two visible filter values before starting the job, and compare them with the values shown in the history after a reload. Then open the downloaded file from the successful attempt and check a known row that should be in it and one that should be absent. That last check connects the interface promise to a real result. A ready badge and a working link can both look correct while the CSV contains the wrong warehouse.
Carry these examples into the component review, with one fixture for each response and a second job that completes out of order. Designers can change the label or adjust the layout without reconstructing the server scenario each time. Developers can use the fixtures to exercise the outcomes that are hard to produce on demand.
Pablo Mayoral
Senior UX/UI & Web Designer with 10+ years of experience. Creator of EmviUI (10k+ components Figma design system), UImand, and Vitamin Bootstrap. Currently designing digital products at CQMRewards.