forked from stack-auth/stack-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard-group.tsx
More file actions
46 lines (40 loc) · 782 Bytes
/
card-group.tsx
File metadata and controls
46 lines (40 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use client';
import { type ReactNode } from 'react';
import { cn } from '../../lib/cn';
export type CardGroupProps = {
/**
* Card components to display in the grid
*/
children: ReactNode,
/**
* Additional CSS classes to apply to the card group
*/
className?: string,
/**
* Number of columns on larger screens (default: 2)
*/
cols?: 1 | 2 | 3 | 4,
}
export function CardGroup({
children,
className,
cols = 2,
}: CardGroupProps) {
const columns = {
1: 'md:grid-cols-1',
2: 'md:grid-cols-2',
3: 'md:grid-cols-3',
4: 'md:grid-cols-4',
}[cols];
return (
<div
className={cn(
'grid grid-cols-1 gap-4 mb-8 items-stretch',
columns,
className
)}
>
{children}
</div>
);
}