The project is in a healthy, maintained state
Self-hosted payment method SVGs in six styles, packaged as a Rails asset engine. Artwork by Aaron Fagan and contributors.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 7.0, < 9
 Project Readme

Parkes Payment Icons

Payment method icons for Rails. Includes 102 SVGs in six styles, with view helpers and support for Propshaft and Sprockets.

Installation

Add to your Gemfile:

gem "parkes-payment-icons", "~> 0.1.0"

Then run bundle install.

Requires Ruby 3.2+ and Rails 7.0–8.1. Use a Ruby version supported by your Rails version.

Propshaft

No additional setup is required.

Sprockets 4

Add the collection to app/assets/config/manifest.js:

//= link parkes_payment_icons.js

To include individual icons instead:

//= link payment_icons/logo/visa.svg

Usage

Render an icon

<%= payment_icon_tag :visa, width: 40 %>
<%= payment_icon_tag :mastercard, variant: :flat_rounded, class: "payment-logo" %>
<%= payment_icon_tag :amex, variant: :mono, size: "40x25", alt: "American Express" %>

payment_icon_tag renders an <img> and accepts the same HTML options as Rails' image_tag. The default variant is logo.

Names and variants accept strings or symbols. Underscores and hyphens are interchangeable: :flat_rounded and "flat-rounded" select the same style. Unknown names or variants raise ArgumentError.

Alt text defaults to the icon name, capitalized. Pass alt: "" for decorative icons, or supply your own label:

<%= payment_icon_tag :visa, width: 40, alt: "", aria: { hidden: true } %>

Get an asset path

<%= payment_icon_path :visa %>
<%= payment_icon_path :visa, variant: :logo_border %>
<%= payment_icon_path :visa, host: "https://assets.example.com" %>

payment_icon_path accepts Rails' image_path options. Both helpers use the asset pipeline, including digested URLs in production.

You can also reference assets directly:

<%= image_tag "payment_icons/logo/visa.svg", alt: "Visa", width: 40 %>

Icons

Each of these 17 icons is available in all six styles:

alipay, amex, code, code-front, diners, discover, elo, generic, hiper, hipercard, jcb, maestro, mastercard, mir, paypal, unionpay, and visa.

Use generic as a fallback for unknown payment brands.

Style Visa Mastercard American Express
flat Visa Mastercard Amex
flat_rounded Visa Mastercard Amex
logo Visa Mastercard Amex
logo_border Visa Mastercard Amex
mono Visa Mastercard Amex
mono_outline Visa Mastercard Amex

Development

bin/setup
bundle exec rake test upstream:check compatibility

To check a different Rails version or asset pipeline:

RAILS_VERSION='~> 7.2.0' ASSET_PIPELINE=sprockets bundle exec rake compatibility

Update the icons

Import a specific upstream commit, then verify the collection:

bundle exec rake 'upstream:update[FULL_COMMIT_SHA]'
bundle exec rake upstream:verify test compatibility

The update task replaces the icon collection and records the source revision and checksums in upstream.json.

See Contributing and the release guide.

License

Apache-2.0. Icons by Aaron Fagan and contributors. See NOTICE for attribution. Payment brand trademarks belong to their respective owners.