@k8ordo/ui

Card

A card that groups content. By default it has a shadow, meant for a bg-subtle page.

Import

ts
import { Card } from '@k8ordo/ui';

Usage

Card content
tsx
<Card>
  <div className={styles.body}>Card content</div>
</Card>

Width

Full width
Fit content
tsx
<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.

tsx
<Card interactive>
  <a className={styles.body} href="https://example.com">
    Hover to scale up
  </a>
</Card>

Appearance

Shadow
Bordered
tsx
<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'
PropTypeDefault
children?ReactNode-
interactive?booleanfalse
variant?'shadow'|'outline''shadow'
width?'full'|'fit''full'

Inherited attributes (except the ones set internally): HTMLAttributes<HTMLDivElement>

k8ordo

React libraries that use Baseline features without holding back.