shadcn.io is not affiliated with official shadcn/ui
Expired Certificate Warning Error Block for React
A full-screen warning for a site whose certificate expired: a drawn open padlock, Back to safety, and an Advanced disclosure with the certificate chain, the error code to copy and an unsafe route behind a checkbox.
Installation
Overview
Stop people from walking into an insecure page, and give the curious the facts, with this expired certificate error for React with Base UI. It's a whole screen with the page's rails and one band across it, its content centred. A padlock drawn open stands over the headline, one sentence says what happened and the Shine Button Back to safety, the only colored control, is the way out. The way on is hidden on purpose: Advanced is a Collapsible that opens a framed panel with the certificate chain as a nested list, the site's own link marked by a heavy edge and the word Expired, with the days since it expired counted from a typed date; the error code with a Copy Button; and the unsafe route behind a Checkbox named I understand the risk. Pressing Continue only says that nothing connects in this demo. The band's rules and the panel's frame come from Guides, and the entrance is CSS only. For a browser, a proxy, a link checker or any app that opens other sites.
FAQ
Does anything connect?
No. The chain, its dates and the error code are typed in the file, and "Continue to the site, unsafe" only says that nothing connects, or asks you to tick the box first. To wire it, check the real certificate on your side, render the real chain here, and send the visitor on only if your policy allows it (many products block the page with no way on at all).
Why is the safe choice the one button?
Because most people should leave, and a warning that makes continuing as easy as leaving is not a warning. Back to safety is the only colored control and first in the order; the unsafe route needs three deliberate steps: open Advanced, tick the box, press the button. The button stays focusable while the box is clear and says what is missing, instead of being disabled and silent.
Where does 287 days ago come from?
From two typed dates: the certificate's last valid day (2025-12-31) and the page's typed today (AS_OF, 2026-10-14), subtracted in UTC. Nothing reads the clock, so the page says the same on the server and in every time zone, and it never goes stale. Change either date and the count and the words follow.
Why does the page start at the top instead of the middle?
Because Advanced makes it taller. Most pages in this set are centred in the screen, but a centred page would move its headline whenever the panel opened or closed; starting at the top keeps everything above the disclosure where it was. The disclosure animates its height, and not at all with reduced motion.
Is it usable with a keyboard and a screen reader?
Tab reaches Back to safety and Advanced, whose expanded state is announced; inside the panel come the Copy button, the checkbox and the unsafe button. The chain is a nested list, so a screen reader reads each link's name, role and last valid day, and the expired one says Expired. Copying says Copied through the button's own polite status; pressing the unsafe button speaks its result.
Related
- Pro
DNS Lookup Chain Error
NetworkA full-screen page for an address that can't be found: an editable address, a Run the check button, and the lookup drawn as five hops that walk one at a time and stop at the one with no answer.
- Pro
CORS Blocked Request Error
NetworkA full-screen page for a cross-origin request the browser blocked: a drawn exchange with the reply's headers and the missing one dashed, the console line in a copy strip, and three fixes with snippets you can copy.
- 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
API Uptime Strips Error
Server and outagesA full-screen outage page for an API host: the display 503, a notify-me form that saves in the page, and four APIs as rows of thirty day-cells with a shape and a word for today and an uptime counted from the minutes.
- Pro
Database Backoff Schedule Error
Server and outagesA full-screen page for a database that refuses connections: Retry now and a switch that retries by itself on a press-started countdown, four pool cells and the backoff schedule drawn to scale.
- Pro
Offline Error
NetworkA full-screen offline page that listens to the browser's real online and offline events: a signal figure, a Check connection button, a Switch to pretend, and what stays available without a network.