# 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.

### Preview

<div align="left"><figure><img src="/files/Zac49HBcIwKK3OtxlmWO" alt="Gravity credit card component" width="314"><figcaption></figcaption></figure></div>

### Usage

```javascript
import { CreditCard } from 'components/lib';

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

### Props

| Prop       | Description                     | Required | Value  |
| ---------- | ------------------------------- | -------- | ------ |
| brand      | card provider name              | required | string |
| expires    | card expiry date                | required | string |
| last\_four | last four digits of card number | required | string |

### 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-web/components/credit-card.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
