Card
A card that groups content. By default it has a shadow, meant for a bg-subtle page.
Import
Copy code
import { Card } from '@k8ordo/ui';Usage
Card content
Copy code
<Card>
<div className={styles.body}>Card content</div>
</Card>Width
Full width
Fit content
Copy code
<Card width="full">
<div className={styles.body}>Full width</div>
</Card>
<Card width="fit">
<div className={styles.body}>Fit content</div>
</Card>Interactive
With interactive, the card grows a little on hover and shrinks a little when pressed. Use it to make the whole card a link or a button.
Copy code
<Card interactive>
<a className={styles.body} href="https://example.com">
Hover to scale up
</a>
</Card>Appearance
Shadow
Bordered
Copy code
<Card variant="shadow">
<div className={styles.body}>Shadow</div>
</Card>
<Card variant="outline">
<div className={styles.body}>Bordered</div>
</Card>Props
children?- Type:
ReactNode - Default: -
interactive?- Type:
boolean - Default:
false variant?- Type:
'shadow'|'outline' - Default:
'shadow' width?- Type:
'full'|'fit' - Default:
'full'
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
interactive? | boolean | false |
variant? | 'shadow'|'outline' | 'shadow' |
width? | 'full'|'fit' | 'full' |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLDivElement>