Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Web

Credit Card

The CreditCard component displays a visual representation of a credit card, showing the brand, expiry date, and last four digits of the card number.

Usage

import { CreditCard } from 'components/lib';

function MyComponent({ ...props }) {
  return (
    <CreditCard 
      brand='Visa' 
      expires='12/24' 
      last_four='1234' 
    />
  );
}

Props

PropDescriptionRequiredValue
brandcard provider namerequiredstring
expirescard expiry daterequiredstring
last_fourlast four digits of card numberrequiredstring

Notes

  • The brand prop specifies the card provider name.
  • The expires prop specifies the expiry date of the card.
  • The last_four prop specifies the last four digits of the card number.