|
| 1 | +--- |
| 2 | +title: "Cards" |
| 3 | +description: "Highlight main points or links with customizable icons" |
| 4 | +icon: "rectangle" |
| 5 | +--- |
| 6 | + |
| 7 | +<Card title="Card Title" icon="link" href="/content/components/card-groups"> |
| 8 | + This is how you use a card with an icon and a link. Clicking on this card |
| 9 | + brings you to the Card Group page. |
| 10 | +</Card> |
| 11 | + |
| 12 | +<RequestExample> |
| 13 | + ```jsx Card Example |
| 14 | + <Card title="Click on me" icon="link" href="/content/components/card-group"> |
| 15 | + This is how you use a card with an icon and a link. Clicking on this card |
| 16 | + brings you to the Card Group page. |
| 17 | + </Card> |
| 18 | + ``` |
| 19 | + |
| 20 | +```jsx Image Card Example |
| 21 | +<Card title="Image Card" img="/images/card-with-image.png"> |
| 22 | + Here is an example of a card with an image |
| 23 | +</Card> |
| 24 | +``` |
| 25 | + |
| 26 | +</RequestExample> |
| 27 | + |
| 28 | +### Horizontal Card |
| 29 | + |
| 30 | +Add a `horizontal` property to make it horizontally displayed. |
| 31 | + |
| 32 | +<Card title="Horizontal Card" icon="text-size" horizontal> |
| 33 | + Here is an example of a horizontal card |
| 34 | +</Card> |
| 35 | + |
| 36 | +### Image Card |
| 37 | + |
| 38 | +Add an `img` property to display an image on the top of the card. |
| 39 | + |
| 40 | +<Card title="Image Card" img="https://mintlify-assets.b-cdn.net/yosemite.jpg"> |
| 41 | + Here is an example of a card with an image |
| 42 | +</Card> |
| 43 | + |
| 44 | +### Link Card |
| 45 | + |
| 46 | +You can customize the CTA and whether or not to display the arrow on the card. By default, the arrow will only show for external links. |
| 47 | + |
| 48 | +<Card |
| 49 | + title="Link card" |
| 50 | + icon="link" |
| 51 | + href="/content/components/card-groups" |
| 52 | + arrow="true" |
| 53 | + cta="Click here" |
| 54 | +> |
| 55 | + This is how you use a card with an icon and a link. Clicking on this card |
| 56 | + brings you to the Card Group page. |
| 57 | +</Card> |
| 58 | + |
| 59 | +<RequestExample> |
| 60 | + ```jsx Card Example |
| 61 | + <Card |
| 62 | + title="Link card" |
| 63 | + icon="link" |
| 64 | + href="/content/components/card-groups" |
| 65 | + arrow="true" |
| 66 | + cta="Click here" |
| 67 | + > |
| 68 | + This is how you use a card with an icon and a link. Clicking on this card |
| 69 | + brings you to the Card Group page. |
| 70 | + </Card> |
| 71 | + ``` |
| 72 | +</RequestExample> |
| 73 | + |
| 74 | +## Props |
| 75 | + |
| 76 | +<ResponseField name="title" type="string" required> |
| 77 | + The title of the card |
| 78 | +</ResponseField> |
| 79 | + |
| 80 | +<ResponseField name="icon" type="string or svg"> |
| 81 | + A [Font Awesome icon](https://fontawesome.com/icons), [Lucide |
| 82 | + icon](https://lucide.dev/icons), or SVG code in `icon={}` |
| 83 | +</ResponseField> |
| 84 | + |
| 85 | +<ResponseField name="iconType" type="string"> |
| 86 | + One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands` |
| 87 | +</ResponseField> |
| 88 | + |
| 89 | +<ResponseField name="color" type="string"> |
| 90 | + The color of the icon as a hex code |
| 91 | +</ResponseField> |
| 92 | + |
| 93 | +<ResponseField name="href" type="string"> |
| 94 | + The url that clicking on the card would navigate the user to |
| 95 | +</ResponseField> |
| 96 | + |
| 97 | +<ResponseField name="horizontal" type="boolean"> |
| 98 | + Makes the card more compact and horizontal |
| 99 | +</ResponseField> |
| 100 | + |
| 101 | +<ResponseField name="img" type="string"> |
| 102 | + The url or local path to an image to display on the top of the card |
| 103 | +</ResponseField> |
| 104 | + |
| 105 | +<ResponseField name="cta" type="string"> |
| 106 | + Label for the action button |
| 107 | +</ResponseField> |
| 108 | + |
| 109 | +<ResponseField name="arrow" type="boolean"> |
| 110 | + Enable or disable the link arrow icon |
| 111 | +</ResponseField> |
0 commit comments