Components

Card

Clickable list card — interactive content container

Overview

Card is a clickable list item. It renders as a <li> element and extends Box with fixed card styles.

  • Interactiverole="button", tabIndex={0}, border on hover
  • Box-based — All Box sprinkle props available
  • Fixed styles — White background, rounded corners, drop shadow

Basic Usage

import { Card } from '@illog/ui'
 
<ul>
  <Card onClick={() => navigate(`/tasks/${task.id}`)}>
    <Text textStyle="bodyStrong">{task.title}</Text>
    <Text textStyle="bodySmall" color="textDefaultTertiary">
      {task.description}
    </Text>
  </Card>
</ul>

Width Control

<Card maxWidth="480px" onClick={handleClick}>
  <Text>Card with max width of 480px</Text>
</Card>

Default Applied Styles

PropertyValue
Element<li>
displayflex
flexDirectioncolumn
gap400
bgbackgroundDefaultDefault
padding600
rounded200
shadow100
hover1px solid border

Props

PropTypeDefaultDescription
onClick(e: MouseEvent) => voidrequiredClick handler
maxWidthstringMax width
childrenReactNodeCard content
classNamestringAdditional CSS class
...boxPropsBoxPropsAll Box props

Guidelines

  • Always use Card inside a <ul> or <ol> (renders as <li>)
  • If you need a non-clickable container, use Box directly