shadcn.io is not affiliated with official shadcn/ui
Menu Editor CRUD Block for Vue
A bistro's menu edited by section with the printed card drawn beside it: rename dishes in place, set whole-euro prices, mark dietary tags and sold out, move dishes within a section, and Remove offers Undo.
Installation
Overview
Show what an edit does to the thing it edits, with this menu editor for Vue with Ark UI. A hairline frame with a plus mark on each corner splits into two panes. At the start the dishes are grouped under Starters, Mains and Desserts, each with its count; a dish has a name that renames in place with an Editable, a price in a Number Input in whole euros, dietary marks as a Toggle Group (Veggie, Vegan, Gluten-free, where vegan always includes veggie), a Sold out Switch, Move up and Move down within the section, and Remove. A quiet row at the end of each section adds a dish. At the end the printed menu is drawn from the same dishes and changes as you type: sections, names, prices, V, VG and GF marks, and sold-out dishes struck through with the words Sold out. Removing a dish leaves "Removed Barley risotto." in the foot beside an Undo, the bands are ruled by Guides, and an empty menu shows an Empty state with one action. For restaurants, shop price lists, catalogues and any list that is printed from the data it edits.
FAQ
How do I fill it with my own dishes?
Edit DISHES and SECTIONS. A dish has an id, a name, a section, a price in whole euros, a diet list of v, vg and gf, and a sold flag. The editor, the counts, the printed card and the status line are all derived from that one list, so nothing is typed twice. New dish ids come from a counter held in state.
How are prices handled?
The price field takes whole euros from 0 to 999. It updates the card as you type and the polite line announces the new price when you leave the field. Anything else, such as letters or a number too large, is refused with its reason and the field goes back to the dish's real price. The card writes the price with a euro sign in a left-to-right run, so it reads the same in right-to-left layouts.
What is the rule between Veggie and Vegan?
A vegan dish is always veggie. Turning Vegan on turns Veggie on too, and turning Veggie off turns Vegan off, so the card can never print VG without V. The toggles are real toggle buttons with a pressed state, and the polite line says which marks the dish now has.
How do I reorder dishes without dragging?
Move up and Move down swap a dish with its neighbour inside its section; a dish already first or last says so instead of moving. Focus stays on the button you used, so you can press it again, and the card follows. Dishes cannot move between sections: add one to the section you want.
What stays local, and how do I wire a real save?
Dishes live in state in this tab and a reload brings the original nine back; nothing is printed or published. In your app send each change from rename, price, diet, sold, move, add and remove to your API, and render the card from what the server returns. Keep Undo as an optimistic step that calls your restore endpoint.