Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

No Payment Methods Empty State Block for React

A checkout settings tool's empty payment methods shown as an add dialog open over a drawn settings page: three type cards (Card, Bank account, Wallet) beside a drawn object that swaps, the services each works with, a nickname, and no number fields.

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

Make adding a payment method the first thing to do, with this no payment methods empty state for React with Base UI. A host panel says what is listed ("Tillhatch has no payment methods yet.") and holds the real Add payment method button, over a stage that draws a settings page: a title bar and three places for methods, the first one dashed. On load the add Dialog is drawn open in place over the page, so the block reads as a dialog and not a blank page. It is only the type step: three cards, Card, Bank account and Wallet, as native radio buttons beside a drawn object that swaps to match (a payment card, a bank slip or a wallet), the services the type works with named in text beside a two-letter tile (Visa, ACH transfer, Apple Pay), and a nickname that is printed on the object as you type. There is no number field anywhere. The Shine Button, the only colored control, follows the type ("Add a card", "Add a bank account") and, once pressed, closes the dialog and turns a dashed place on the page behind into a card with the method's icon and nickname. The frame is ruled by Guides, the objects are three small drawings in one cell, and the transitions are CSS only. For the payment step of any checkout, store or billing settings page.

FAQ

Which part is only for the preview?

Shown open in place for the preview: on load the dialog is drawn in place, a native non-modal dialog over a drawing of the page, so nothing is trapped or focused. Add payment method opens the real Dialog, with its focus trap, Escape and focus return to the button, and the in-place copy stays closed until a reload. Both share the same fields and state, so a type or a nickname chosen in place is there in the real one. In your app keep the Dialog and drop the in-place copy, the scrim and the Escape listener on the stage.

Where do the card or account numbers go?

Nowhere here, on purpose. The dialog has no number, expiry or security-code field, and it says so: numbers are entered in your payment provider's hosted fields, never in your own page. To make it real, open the provider's hosted fields (or its own form) from the button after the type step, and list the method it confirms. The services named beside each type are real names in text with a two-letter tile, never logos.

What stays in the page?

The list is state in the page: nothing is saved, charged or sent, and the words say "listed here only" and "Nothing was saved or charged." The demo lists three methods; a fourth is refused with a line that says so, and Start over, next to the button, empties the list and puts the first type back. To wire it for real, save the type and the nickname with your API where the code says so, and list what it returns.

How does the drawn object swap without moving anything?

The three objects are stacked in one grid cell of one size, and the chosen one is visible while the other two are hidden, so the dialog is the same height for every type. The nickname is real text laid over the dashed box of the object, so it follows your font; the drawings are decorative and hidden from assistive technology, and the radio buttons and the button's label say what was chosen.

Is it usable with a keyboard and a screen reader?

The type cards are one radio group, so the arrow keys move between them and the choice is spoken; Tab goes on to the nickname and the footer buttons. Enter in the nickname adds the method. Escape and Cancel close the dialog and return focus to Add payment method, and a missing nickname is refused in a line under the field with focus moved to it. One polite status message says each change, inside the dialog while it is up and on the page once it is closed.

How does it look on a phone?

The in-place dialog docks to the foot of the stage with its footer pinned, so Add a card is always on screen while the body scrolls; the real dialog keeps the catalog's phone layout from the bottom of the screen. The two lines of services under the type cards have room reserved for two lines, so choosing a type never shifts the nickname.

  • Pro

    Payment Method Billing

    Payment and invoices

    Payment methods in app settings: the card on file with an expiry warning, a backup bank account, a button that sets the default, and a dialog that checks and updates the card.

  • Pro

    Recurring Payment Dialog

    Payments and plans

    A rent page with its autopay dialog shown open: an amount, how often, a start day from a folded inline calendar, when it ends, and the next four payment dates worked out under the fields.

  • Pro

    A full-height first-plan screen for a billing tool: a name, a price and a Monthly or Yearly switch, a drawn plan card that previews them, and a worked-out line for ten subscribers, with a coin inside two arrows that turns solid when the plan is created.

  • Pro

    A full-height first-invoice screen for an invoicing app: a client field, three line items with the totals worked out in whole cents as you type, and a drawn invoice paper that fills line by line before one Create invoice button lists the draft.

  • Pro

    A document tool's share dialog shown open over a drawn page: three access cards beside a padlock that is shut, ajar or open, a people field with a pick list of five teammates, avatar chips, and a Share with 2 people button.

  • Pro

    Connect Tools Empty State

    Apps and integrations

    A full-height first-run screen for an integration hub: six tool cards with checkboxes at the end, and at the start a drawn hub whose spokes turn from dashed to solid, and whose sockets take a lettermark, as each tool is ticked.