shadcn.io is not affiliated with official shadcn/ui
Drafts Desk Blog Block for Solid
A drafts list for a writing-tools blog: each row has a status badge, a progress bar with its word count, the fixed time it was edited and a menu to edit, duplicate or archive it.
Installation
Overview
A drafts desk for Solid with Ark UI, written for Fairleaf, a blog about tools for writers. A start-aligned header sits over a count band and five drafts as rows that run from rail to rail. Each row has the title, a status Badge (Outline, Drafting or Needs edit), the author, a Progress bar with "1,240 of 1,800 words", the fixed time it was last edited, and a menu with Edit, Duplicate and Archive. Duplicate puts a copy at the top, Archive takes the row away and turns on Undo archive, and Edit only says what it would do. It's built from Badge, Progress, DropdownMenu, Button and Guides. Nothing is saved in this demo: the changes live in this page and a reload brings the five drafts back. Word counts and edit times are example data.
FAQ
What do the menu items really do?
They change the block's own state and say so. Duplicate adds a copy titled "(copy)" at the top, with the Outline status and no words. Archive removes the row and enables Undo archive, which puts it back where it was. Edit changes nothing and says it would open the draft in the editor. A polite status line under the count reads each result, and nothing is saved in this demo.
Where does the count come from?
It is worked out from the rows: "5 drafts, 2 need an edit" counts the drafts shown and the ones with the Needs edit status, so it changes when you duplicate or archive. The progress bars and the percentage come from each draft's words and target.
How is the status shown without colour?
Each status has a word and an icon (a list, a pencil, a flag) and the three differ in weight, not hue: Drafting is a filled neutral badge and the other two are outlined. The bars use the foreground colour on a neutral track.
How do the menu and the keyboard work?
Each row's three-dot button is named for its draft ("Actions for ..."), opens with Enter or Space, moves with the arrow keys and closes with Escape.
Each item takes onSelect and a value.