Skip to content

Commit 9951c26

Browse files
committed
Update cards
1 parent 3591658 commit 9951c26

File tree

1 file changed

+71
-61
lines changed

1 file changed

+71
-61
lines changed

components/cards.mdx

Lines changed: 71 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,141 @@
11
---
22
title: "Cards"
3-
description: "Highlight main points or links with customizable icons"
4-
icon: 'square-mouse-pointer'
3+
description: "Highlight main points or links with customizable layouts andicons"
4+
icon: "square-mouse-pointer"
55
---
66

7-
<Card title="Card Title" icon="text" href="/components/columns">
7+
Use cards to create visual containers for content. Cards are flexible containers that can include text, icons, images, and links.
8+
9+
## Basic card
10+
11+
<Card title="Card title" icon="text" href="/components/columns">
812
This is how you use a card with an icon and a link. Clicking on this card
913
brings you to the Columns page.
1014
</Card>
1115

12-
<RequestExample>
13-
```mdx Card Example
14-
<Card title="Click on me" icon="text" href="/components/columns">
15-
This is how you use a card with an icon and a link. Clicking on this card
16-
brings you to the Columns page.
17-
</Card>
18-
```
19-
20-
```mdx 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
16+
```mdx Card example
17+
<Card title="Card title" icon="text" href="/components/columns">
18+
This is how you use a card with an icon and a link. Clicking on this card
19+
brings you to the Columns page.
2320
</Card>
2421
```
2522

26-
</RequestExample>
23+
## Card variations
2724

28-
## Horizontal card
25+
Cards support several layout and styling options to fit different content needs.
2926

30-
Add a `horizontal` property to display cards horizontally.
27+
### Horizontal layout
3128

32-
<Card title="Horizontal Card" icon="text" horizontal>
33-
Here is an example of a horizontal card
29+
Add the `horizontal` property to display cards in a more compact, horizontal layout.
30+
31+
<Card title="Horizontal card" icon="text" horizontal>
32+
This is an example of a horizontal card.
3433
</Card>
3534

36-
## Image card
35+
```mdx Horizontal card example
36+
<Card title="Horizontal card" icon="text" horizontal>
37+
This is an example of a horizontal card.
38+
</Card>
39+
```
40+
41+
### Image cards
3742

38-
Add an `img` property to display an image on the top of the card.
43+
Add an `img` property to display an image at the top of the card.
3944

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
45+
<Card title="Image card" img="https://mintlify-assets.b-cdn.net/yosemite.jpg">
46+
This is an example of a card with an image.
4247
</Card>
4348

44-
## Link card
49+
```mdx Image card example
50+
<Card title="Image card" img="/images/card-with-image.png">
51+
This is an example of a card with an image.
52+
</Card>
53+
```
4554

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.
55+
### Link cards with custom CTAs
56+
57+
You can customize the call-to-action text and control whether an arrow appears. By default, arrows only show for external links.
58+
59+
<Card title="Link card" icon="link" href="/components/columns" arrow="true" cta="Click here">
60+
This is an example of a card with an icon and a link. Clicking on this card brings you to the Columns page.
61+
</Card>
4762

63+
```mdx Link card example
4864
<Card
4965
title="Link card"
5066
icon="link"
5167
href="/components/columns"
5268
arrow="true"
5369
cta="Click here"
5470
>
55-
This is how you use a card with an icon and a link. Clicking on this card
56-
brings you to the Columns page.
71+
This is an example of a card with an icon and a link. Clicking on this card brings you to the Columns page.
5772
</Card>
58-
59-
<RequestExample>
60-
```mdx Card Example
61-
<Card
62-
title="Link card"
63-
icon="link"
64-
href="/components/columns"
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 Columns page.
70-
</Card>
71-
```
72-
</RequestExample>
73+
```
7374

7475
## Grouping cards
7576

76-
You can group cards in [columns](/components/columns).
77+
Use the [Columns component](/components/columns) to organize multiple cards side by side.
7778

7879
<Columns cols={2}>
79-
<Card title="First Card" icon="panel-left-close">
80+
<Card title="First card" icon="panel-left-close">
8081
This is the first card.
8182
</Card>
82-
<Card title="Second Card" icon="panel-right-close">
83+
<Card title="Second card" icon="panel-right-close">
8384
This is the second card.
8485
</Card>
8586
</Columns>
8687

87-
## Props
88+
```mdx Columns example
89+
<Columns cols={2}>
90+
<Card title="First card" icon="panel-left-close">
91+
This is the first card.
92+
</Card>
93+
<Card title="Second card" icon="panel-right-close">
94+
This is the second card.
95+
</Card>
96+
</Columns>
97+
```
98+
99+
## Properties
88100

89101
<ResponseField name="title" type="string" required>
90-
The title of the card
102+
The title displayed on the card
91103
</ResponseField>
92104

93105
<ResponseField name="icon" type="string or svg">
94-
A [Font Awesome icon](https://fontawesome.com/icons), [Lucide
95-
icon](https://lucide.dev/icons), or JSX compatible SVG code in `icon={}`.
96-
97-
To generate JSX compatible SVG code:
98-
106+
Icon to display on the card. Use a [Font Awesome icon](https://fontawesome.com/icons) name, [Lucide icon](https://lucide.dev/icons) name, or JSX-compatible SVG code wrapped in `icon={}`.
107+
108+
For custom SVG icons:
99109
1. Use the [SVGR converter](https://react-svgr.com/playground/).
100110
2. Copy the code inside the `<svg/>` tag.
101-
3. Paste the code into your card. Make sure to only copy and paste the code inside the `<svg/>` tag.
102-
4. You may need to decrease the height and width to make the image fit.
111+
3. Paste the code into your card.
112+
4. Adjust height and width as needed.
103113
</ResponseField>
104114

105115
<ResponseField name="iconType" type="string">
106-
One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`
116+
Font Awesome icon style: `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, or `brands`.
107117
</ResponseField>
108118

109119
<ResponseField name="color" type="string">
110-
The color of the icon as a hex code
120+
Icon color as a hex code (e.g., `#FF6B6B`).
111121
</ResponseField>
112122

113123
<ResponseField name="href" type="string">
114-
The url that clicking on the card would navigate the user to
124+
URL to navigate to when the card is clicked.
115125
</ResponseField>
116126

117127
<ResponseField name="horizontal" type="boolean">
118-
Makes the card more compact and horizontal
128+
Display the card in a compact horizontal layout.
119129
</ResponseField>
120130

121131
<ResponseField name="img" type="string">
122-
The url or local path to an image to display on the top of the card
132+
URL or local path to an image displayed at the top of the card.
123133
</ResponseField>
124134

125135
<ResponseField name="cta" type="string">
126-
Label for the action button
136+
Custom text for the action button.
127137
</ResponseField>
128138

129139
<ResponseField name="arrow" type="boolean">
130-
Enable or disable the link arrow icon
140+
Show or hide the link arrow icon.
131141
</ResponseField>

0 commit comments

Comments
 (0)