Components

CardButton

A card that is a single button as a whole

Overview

CardButton is a card where the whole surface is one button, such as an item in the project list or a statistics card that opens more detail. Its hover, pressed and selected colors belong to the component. Spacing, radius and layout come from Box props.

Do not put other buttons or inputs inside it. A button cannot contain another control.

Selected

Use aria-current for the item currently shown from a list. Use aria-pressed for a card that toggles on and off.

Props

PropTypeDefaultRequiredDescription
aria-currentboolean-Notrue for the item currently shown in a list. Darkens the border
onClickMouseEventHandler<HTMLButtonElement>-NoClick handler
childrenReactNode-YesCard content (no buttons or inputs)
classNamestring-NoExtra CSS class

Specification

base

상태요소속성값
enabledrootborderWidth$size.stroke.border
enabledrootborderColor$color.border.default.default
enabledrootbackgroundColor$color.background.default.default
hoverrootbackgroundColor$color.background.default.defaultHover
pressedrootbackgroundColor$color.background.default.defaultPressed
selectedrootborderColor$color.border.default.secondary
focusVisiblerootoutlineWidth$size.stroke.focus
focusVisiblerootoutlineStylesolid토큰 아님 — no line style token
focusVisiblerootoutlineColor$color.border.focus.default
focusVisiblerootoutlineOffset2px토큰 아님 — no ring offset token

Usage Guidelines

Do

  • Use Text with as="span" inside, since a button should only contain text-level content
  • Keep the same spacing for every card in a list

Don't

  • Don't nest buttons, links or inputs inside a CardButton
  • Don't build a clickable card from Box, Stack or Inline. They have no hover, focus or selected styles