# Payment Methods

A row of small labels for the payment methods a shop accepts.

- Category: Commerce
- Page: https://wunderui.com/components/payment-methods
- Tier: Core and Pro

## Install

Payment Methods ships with WunderUI Core and Pro in the @wunderui/react package.

## Import

```tsx
import { PaymentMethods, PAYMENT_METHODS, PaymentMark } from "@wunderui/react"
```

## Minimal usage

Then use it:

```tsx
import { PaymentMethods } from "@wunderui/react"

export function AcceptedMethods() {
  return (
    <div className="flex flex-col items-center gap-2">
      <p className="text-xs text-text-tertiary">We accept</p>
      <PaymentMethods methods={["VISA", "MC", "AMEX", "PayPal"]} className="justify-center" />
    </div>
  )
}
```

Expected result: You see the text We accept and under it a centred row of four small chips reading VISA, MC, AMEX and PayPal.

## When to use

### Use Payment Methods for

- The accepted methods under a pay button or in the footer of a checkout
- A short reminder in a cart, a pricing page or a shop footer
- A list of names that changes by market or by order

### Use something else

- [Radio Group](https://wunderui.com/components/radio-group) for choosing one payment method
- [Selector Item](https://wunderui.com/components/selector-item) for a list of methods to pick from, each with a description
- [Badge](https://wunderui.com/components/badge) for a status or a count on another element, not a name in a row

## Behavior

What Payment Methods does with its list, its width and its text. It is display only: no hover, focus, keyboard or loading behaviour.

- **A row of text, not controls:** The row is a div with the group role and each chip a span, with no role, focus stop or hover state, and a click does nothing. To let people choose a method, use Radio Group or Option Row Group.
- **Names, not logos:** Every chip shows the string you passed, with no brand colour or mark. The component does not expand MC, so write Mastercard where the short form would not be understood.
- **Screen readers:** A screen reader announces the group named Accepted payment methods, then reads the chips as plain text, such as VISA MC AMEX. A visible label in front is still the better signal.
- **Size and wrapping:** A chip is 24 px high, at least 40 px wide and grows with its name, and the row wraps 4 px apart. A parent narrower than one chip makes the name wrap inside it, so keep it wider.
- **Alignment:** The row is as wide as its parent and chips start on the left. A class on the row, such as justify-center or justify-end, aligns them; margin and width work the same way.
- **Keys and an empty list:** The name is the React key of its chip, so two equal names log a duplicate key warning. An empty list draws an empty row with no height that still takes its place in the layout.
- **Colour:** Chips use the card fill, border and secondary text colour, all theme tokens that no prop can change. A chip is not tinted per method, so VISA and PayPal look the same.
- **Motion and reduced motion:** Nothing is animated, so there is nothing to reduce under reduced motion.

## Anatomy

- `PaymentMethods`: A group named Accepted payment methods that lays the chips out in a wrapping row, 4 px apart, as wide as its parent and starting on the left. It takes the methods and the attributes of a div.
- `Chip`: One span per name: 24 px high, at least 40 px wide, with a border, a 4 px radius and the name in 10 px medium text. There is no logo and no icon.
- `PaymentMark`

## Best practices

### When to use

- Use Payment Methods in a cart or checkout footer to show which methods are accepted. It is display only.

### Do

- Pass only the methods you accept, and change the list by market. The default list is VISA, MC, AMEX, PayPal, Apple Pay and Klarna.
- Write a label such as We accept before the row, because the chips are plain text. A screen reader announces the row as a group; pass an aria-label to name it for your page.
- Keep names short, as in the defaults. A chip grows with its name, but a row narrower than one chip makes the name wrap and run out of the chip.
- Align the row with a justify class when it sits in a centred or right-aligned area.

### Don't

- Don't expect logos or an interactive choice: the chips are plain text and not selectable. To let people pick a method, use Radio Group or Option Row Group.
- Don't pass the same name twice. The name is the React key, so a repeat logs a warning and one of the two chips may not render.
- Don't render the row with an empty list. It draws nothing but still takes its place in the layout, so hide it yourself.

## API reference

### PaymentMethods

| Prop | Type | Default | Description |
|---|---|---|---|
| methods | string[] | ["VISA", "MC", "AMEX", "PayPal", "Apple Pay", "Klarna"] | The names of the accepted methods, one chip each, in this order. `VISA`, `MC`, `AMEX`, `PayPal`, `Apple Pay` and `Klarna` by default. Each name must be unique, because it is the key of its chip. |

Also accepts React.HTMLAttributes attributes.

### PaymentMark

| Prop | Type | Default | Description |
|---|---|---|---|
| name* | "PayPal" \| "Visa" \| "Mastercard" \| "Amex" \| "SEPA" \| "Apple Pay" \| "Google Pay" \| "Bank transfer" |  | Which payment method. |
| label | string |  | Accessible name. Defaults to the method name; pass "" when the text beside it already names it. |
| size | "sm" \| "md" | "md" | `sm` 24 × 15 for table cells and dense rows, `md` 32 × 20 for forms and lists. Default `md`. |

Also accepts React.HTMLAttributes attributes.

## Examples

### Methods: the names you pass

### Alignment: start, centre or end

### Width: the chips wrap when the row is narrow

## In context

### Checkout: the methods of the market under the pay button

The summary is the same in every market; only the amounts and the list of methods change. A label above the row says what it is, and the pay button is the gradient call to action.

### Footer: the row beside the legal links

The row sits on the right of the footer and moves below the links on a narrow screen, where the chips start on the left.

### Payment Mark: the brand of a card or account

Where a row shows how something was paid (a transaction, an invoice, a saved card), PaymentMark draws the method as a small card: Visa, Mastercard, Amex, SEPA, Apple Pay, Google Pay, PayPal and bank transfer. `sm` is 24 × 15 for table cells, `md` 32 × 20. It is an image with the method's name; pass `label=""` when the text beside it names the method.

## For AI agents

`get_component("payment-methods")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
