Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

New Version Dialog Block for React

A desktop writing app with an update dialog shown open: the version change as a mono pair with its size, release notes grouped by kind in a one-open accordion, a remind-me choice, a skip link and a bounded pretend update that fills a progress line.

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

Offer an update without hiding what is in it, with this dialog for React with Base UI. It opens from Scrivenhall, a markdown writing app: the page's header holds an outline Update available Button, and the app window, a title bar with its version and an update chip over a page of text lines, is drawn under a soft scrim inside a hairline frame with a plus mark on each corner. The Dialog shows the version change as a mono pair, 4.12 to 4.13, with its size, then the release notes in a one-open Accordion inside a Scroll Area: New 3, Improved 4, Fixed 5, each opening to its one-liners in a box that never changes height. A Select chooses when to be reminded, which the outline Not now applies, and a Skip this version link sits at the start of the foot beside the only Shine Button, Update and restart. That runs a pretend update: a Progress line fills over a second and a half, then the dialog says it updated and the drawn title bar behind it reads 4.13 with the chip gone. For preview the dialog is drawn open in place when the page loads; the header button opens the real Dialog. For desktop apps, plugins and any product that ships versions.

FAQ

Why is the dialog already open, and what do I keep?

So you can see it without a click. On load the dialog is a copy drawn in place over the app window: a native dialog element that isn't modal, so nothing is trapped, hidden or focused, and the page around the preview keeps working. The Update available button opens the real Dialog, modal, with its focus trap, Escape and focus return, and the copy stays closed until a reload. Both show the same UpdateFields component and share the block's state, so a reminder chosen in the copy is there in the real one. In your app keep the Dialog and drop the copy: the "in-place" state, the scrim and the dialog element inside the frame.

What does Update and restart actually do?

Nothing leaves the page. The button spins, the progress line fills over about a second and a half with a CSS transition, and a timer ends the run: it is bounded, so it cannot hang. Under reduced motion the line jumps and the run ends almost at once. While it runs Escape, the close button and the other buttons are refused and a polite message says so; afterwards the dialog says "Updated to 4.13 in this demo. Nothing was installed." and the button becomes Done. In your app start the real download from submit, drive the line from its progress, and restart when it finishes.

What do Not now and Skip this version do?

Not now applies the Remind me choice, In an hour, Tomorrow or Next launch: the dialog closes, a polite message says when, and the drawn chip behind it reads "Reminder: tomorrow". Skip this version closes it and the chip reads "4.13 skipped". Nothing is scheduled or stored: both are state in the block, and your app would save the reminder and the skipped version on the user's device or account.

Why are the notes in a box with its own scroll?

So the dialog keeps its height whichever group is open. The accordion allows one group open at a time and never closes the last one, and the box is a fixed height: the longest group, Fixed with five notes, scrolls inside it. Each group's count is in its title, and the notes are plain typed lines you would load from your changelog.

What stays local in the demo, and how do I wire it up?

All of it. The versions, the size, the date and the notes are typed constants, the update is a pretend one, and the stage's title bar and chip follow the block's state. In your app load the notes from your release feed, check the version on launch, and keep the Remind me and Skip choices where the next launch can read them.

Is it accessible from the keyboard?

Yes. The real dialog is named Scrivenhall 4.13 is ready, focus starts inside and stays there until it closes, and Escape and the close button return focus to the header button. The release notes are an accordion with one tab stop per group, the Select opens with Enter or the arrow keys, and the running update is announced. The trigger is passed to DialogTrigger through render, and the dialog is controlled with open and onOpenChange. The copy shown on load moves no focus; Escape inside it and its close button close it and put focus on the button.

  • Pro

    Loading Dialog

    Status and errors

    A release tool's page with its publish alert shown open: a four-step run that starts when you press the button, never moves the dialog while it waits, shows skeleton boxes where the file sizes will be, and can be stopped.

  • Pro

    Terms Accept Dialog

    Confirm and consent

    A marketplace sign-up at its last step with the terms shown open: an alert dialog with six sections in a focusable scroll region, a reading bar, and a checkbox that stays off until the end has been reached.

  • Pro

    Rate Limit Dialog

    Status and errors

    An API console with its 429 notice shown open: a dialog with the quota used, the plan's limit, a clock to the reset and a Countdown Button that turns into Retry request when the wait ends.

  • Pro

    Save Draft Dialog

    Notes and editing

    A publishing editor with its save-draft dialog shown open: a name, a folder, an autosave choice with a sentence that follows it, and a discard that asks again in the same row.

  • Pro

    Two Actions Dialog

    Confirm and consent

    A mail client with its sent confirmation shown open: a dialog with a View message button and an Undo whose label counts down from 10 while a fill drains, with Return to drafts staying on the page.

  • Pro

    A changelog email panel of subscription cells on shared hairlines, one per product area with its release strip and a Follow toggle, a delivery choice, locked breaking changes and a computed email volume.