Skip to main content
Build your own accordion, tabs, or any layout. This component is a pure content renderer; no fetching, no global listeners, and no expand/collapse behavior. You render the title, subtitle, logos, and surrounding UI. The component handles the content area, including regulatory compliance and formatting.
Because you render the subtitle yourself, the component can’t read its size; it’s a sibling in your DOM, and CSS can’t inherit sideways. To make the expanded content match your subtitle, set font-size on the group to the same value: resurs-payment-method-group { font-size: 14px; }. See Font size.

Fetch payment method groups

The flattened parameter is optional. When true, every payment method is returned as its own group with a single entry in methodIds. When false or omitted, related payment methods may be grouped together (e.g. part-payment options bundled into one group). Response shape:
internalData is opaque. Don’t parse, modify, or inspect it. Pass it directly to the component as-is.

Interactive example

Render the components

Every group stays in the DOM regardless of active: toggling it only switches between the expanded and collapsed views under the header you built.

Props

Controlled component pattern

This component is fully controlled and never mutates its own props. When the user interacts with the component (for example, by selecting an installment option), it fires a resursPaymentMethodSelected event. To update the UI, pass the id from that event back to the component via the selected-id prop. When active is false, the group renders a collapsed view instead of being hidden. This view displays payment method copy, which may include legally required content such as representative examples. If a payment method has no collapsed copy, nothing is rendered and no space is reserved. Changing active to true expands the group and fires the initial resursPaymentMethodSelected event described below.
Never hide, unmount, or display: none an inactive group. Its collapsed view shows legally required copy that must stay visible. Build accordions or tabs by toggling active only; every group must remain rendered.
When active becomes true, the component fires an initial resursPaymentMethodSelected event with the default selection. Always handle this event. The id is what you pass to the Merchant API when creating a payment.

Payment method icon

<resurs-payment-method-icon> renders the brand icon for a given payment method. Pass a payment method type via the type attribute and the component displays the corresponding logo.
string
Payment method type, from type in the payment methods group response. If an unsupported type is passed, a warning is logged to the console and no icon is rendered.

Resurs payment methods

Third-party payment methods

Example

Styling

The <resurs-payment-method-icon> component renders SVG logos and can be styled with standard CSS. The SVG scales proportionally, so setting one dimension (e.g. height) and leaving the other as auto keeps the aspect ratio.
Custom sizing via inline style
Custom sizing via CSS
You can also wrap the icon in a container and style the surrounding layout:
Badge-style