shadcn.io is not affiliated with official shadcn/ui
Unsynced Account Empty Inbox Error Block for React
A team inbox that is empty because an account is not synced: two accounts with state, last-checked time, a sync switch and Sync now, a dashed tray that becomes three messages, and one button to sync all.
Installation
Overview
Answer the question behind an empty inbox, empty or not synced, with this unsynced account inbox for React with Base UI. It's the shared inbox of Postwren, a team inbox: a header over one framed panel, its bands ruled by Guides. A band lists the two connected accounts, Work and Personal, each with a two-letter tile, its address, a state in words and a shape (Synced, Paused or Not synced yet), when it was last checked, a Switch for syncing it and a Button, Sync now. Sync now on Work answers "Checked: 0 new" and only moves the time. Personal is paused: Sync now asks for its switch, and once the switch is on a sync brings in three typed messages, so the dashed tray in the inbox band turns into a three-row list. The one Shine Button, Sync all accounts, checks every account that is on and skips the paused ones; Start over puts it all back. It's built from Switch, Button, Shine Button and Guides, with a CSS entrance only. For mail, support and any inbox fed by connected accounts.
FAQ
How does it decide what is empty?
The inbox lists the typed messages of every account that has been pulled. An account is pulled when it is switched on and synced and it has mail waiting; Work has none, so syncing it changes only its time. The state word, the counts ("1 of 2 syncing", "0 messages"), the empty-tray sentence and the status line are all worked out from the accounts, so they agree.
What happens when Sync now is pressed on a paused account?
Nothing is synced: the status line says Personal is paused, and focus moves to its switch, which is what the person has to change. Turning the switch on makes the state Not synced yet; the next Sync now does the work. Pausing it again keeps what already arrived.
What stays in the page, and how do I wire it?
Everything. The accounts, the times (each sync reads the next minute after 14:10 UTC) and the three messages are typed in the file; nothing connects or fetches. Replace the sync handlers where the code says so with a call to your mail backend, and update the accounts and the inbox from its answer. Never store an account's password in the page.
Does the panel change height?
No. The empty tray and the list of three messages share one box, the unseen one kept in the same cell, and each state word sits over an unseen copy of the longest one, so rows and bands never move.
Related
- Pro
Empty Inbox Notification
Live and empty statesA whole-screen empty inbox that can change: a drawn empty tray and one sentence, with muted conversations that come back when you unmute them and go away again when you mute them.
- Pro
No Notifications Empty State
Activity and updatesAn activity inbox's bell popover shown open in place: You're all caught up, a cup of tea whose three wisps of steam turn solid as Mentions, Replies and Updates are switched on, and a Save preferences button that says Saved in this demo.
- Pro
Email Client Sidebar
App contentA mail client in a fixed-height window: mailboxes and labels whose counts follow the mail you file, a searchable message list beside the open message, and Compose for a local draft.
- 1,248Pro
Data Sync Live Banner
Live statusA sync callout for a data warehouse: one run plays on load, a counter rolling up to 1,248 records over a thin progress bar, then "Warehouse synced" with a countdown to the next run.
- Pro
Connection Fallback Error
NetworkA full-screen page for a live connection that dropped and fell back: three signal bars, three transport rows with a shape and a word each, Reconnect now as a short scripted attempt, and a Keep using polling toggle.
- Pro
Active Sessions Account
Sessions and devicesThe open sessions of an account with how each one signed in, when it started, was last active and ends, an idle filter, a two-step sign-out per row and one button that signs out the rest.