Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

No Saved Searches Empty State Block for Svelte

A search tool's Saved searches popover, drawn open over a results list: the search on screen with two filter chips you can leave out, a name field, a Save search button and two rows that each get a Daily digest switch.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Show an empty list of saved searches with the one popover that fills it, with this no saved searches empty state for Svelte with Ark UI. A header holds the real Saved searches button for Lensly, a search tool. Under it a stage draws a results list with a twin of that button above it, and drawn open in place is the app's popover card: a search bar with a ribbon tab hanging off it (dashed while nothing is kept), the search on screen with two filter chips you can leave out, an Input for the name and the Shine Button, the only colored control: Save search. Saving adds a row to the card's list, two rows high, each with a Daily digest Switch, and the ribbon turns solid. The card keeps a search and nothing else; running it again is for the results page. The frame's corners come from Guides, and the whole block uses CSS transitions only. Shown open in place for the preview; in your app keep the Popover and drop the in-place copy.

FAQ

What happens when I press Save search, and what stays in the page?

The name, the query and the number of filters you kept go into the page's state and a row appears in the card's list; the field clears. The Daily digest switch is only a switch: nothing is scheduled and no mail is ever sent. Reload and the list is empty, and Start over empties it without a reload. To wire it for real, send the query, the filters and the name to your API where the code says so, and list what comes back.

What do the two chips do?

They are the filters of the search on screen, Owner: Me and Updated: This week. Each is a checkbox drawn as a pill: pressed, it is kept in the saved search; turned off, it is left out, and the row says "unpaid invoices, 1 filter". A check mark shows on a kept chip, so the state is not only a colour.

What part is the preview's, and what is real?

On load the card is drawn in place on the stage so the page does not trap or move focus. The Saved searches button opens the real, non-modal Popover (Escape closes it and focus goes back to the button) and the in-place copy stays closed until a reload. Both share one form and the page's state, so what you typed in place is there in the real card. In your app keep the Popover and delete the in-place copy.

Is it usable with a keyboard and a screen reader?

Tab reaches the two chips, the name field, Save search and each row's switch, which is named "Daily digest for" the search. Save search with an empty name says so and puts focus back in the field. The results behind the card are drawn and hidden from assistive technology; the polite status line says what was saved.

Why only two saved searches?

The card has a row for each and the demo keeps two, so the empty list and the full one are the same height. A third press says so ("The demo keeps two. Start over.") and Start over empties the list. With your own data, let the list grow.

How does it look on a phone?

The card docks to the foot of the stage and scrolls inside itself, with the search and the name field at the top so you can type at once; the description folds away. The real popover keeps the catalog's phone layout.