shadcn.io is not affiliated with official shadcn/ui
Tax Report Web3 Block for Ark UI
A gains report for a tax year and a lot method: eleven typed sales matched to purchase lots, totals for short-term, long-term, losses and net, rows that open their lots, and a real CSV download.
Installation
Overview
Turn a year of sales into gains and losses, and see how the lot method changes them, with this tax report for React with Ark UI. It's Filewell, a tax report tool, and every figure is an example, not tax advice. A Native Select picks the tax year (2024 or 2025) and a Segment Group the lot method: first in, first out, highest cost first or average cost. One helper matches eleven typed sales to thirteen typed purchase lots, so each sale gets its proceeds, cost basis, gain or loss and term, long after 365 days. A totals band shows short-term, long-term, losses and net, and each sale is a Collapsible row that opens the lots it used. Export CSV saves the rows on screen as a real file. For tax tools, accounting apps and any report that explains its own numbers.
FAQ
What do the three methods do?
First in, first out sells the oldest lot first. Highest cost first sells the lot that cost most, which usually gives the smallest gain. Average cost uses one average price for everything held at the time of the sale; because average cost has no single lot, its terms still follow the oldest lots, and the status line says so. Sales are matched in date order across both years, so the lots used in 2024 are not available again in 2025.
How are short and long term decided?
By days held, per matched lot: more than 365 days between the purchase and the sale is long-term. A sale that used lots on both sides of that line is Mixed, and its gain is split between the short-term and long-term totals. Losses add up every losing lot on its own.
What does Export CSV save?
A real file made in your browser from the rows on screen: date sold, asset, quantity, proceeds, cost basis, gain, term and the lots used, with CRLF line ends. The name says the year and method, for example filewell-2025-fifo.csv, and the status line confirms the number of rows. Nothing is uploaded.
What stays local, and how do I wire it?
All of it. The sales and lots are typed constants; nothing is read from a wallet, an exchange or a tax authority. This is an example and not tax advice, since real rules depend on the country, the year and the asset. In your app load transactions from your ledger, let the user pick their method where the law allows it, and have the rules reviewed by a professional.
Is it accessible from the keyboard?
Yes. The year is a native select, the method a radio-style Segment Group, and every sale is a button that says whether it is open. Each cell carries a hidden label (Proceeds, Cost basis, Term), results carry the words gain or loss, and one polite status message reports changes and downloads.