Components/CardItem
Universal Component

CardItem

Compact list row with avatar, text, right-side actions, and clickable states.

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

CardItem

TxCardItem is a compact row primitive for settings, command lists, and lightweight navigation. It renders optional avatar content, primary text, supporting copy, and right-side controls while keeping click handling explicit through clickable.

import { ref } from 'vue' const enabled = ref(true)

Basic Usage

CardItem

Demo will load when visible.
<template>
  <TxCardItem title="Enable feature" description="Right area supports actions" icon-class="i-carbon-settings">
    <template #right>
      <TxSwitch v-model="enabled" />
      <i class="i-carbon-chevron-right" />
    </template>
  </TxCardItem>
</template>

API

Props

PropTypeDefaultDescription
rolestring'button'ARIA role applied to the root element.
titlestring''Primary single-line label when the title slot is not used.
subtitlestring''Secondary single-line label rendered below the title.
descriptionstring''Supporting copy rendered below the top row.
iconClassstring''Icon class rendered in the avatar area when no avatar URL is provided.
avatarTextstring''Text fallback rendered in the avatar area.
avatarUrlstring''Image URL rendered before icon or text avatar fallbacks.
avatarSizenumber36Avatar size in pixels.
avatarShape'circle' | 'rounded''circle'Avatar corner style.
clickablebooleanfalseEnables pointer cursor, focusability, and click / Enter emits.
activebooleanfalseApplies the selected visual state.
disabledbooleanfalseDisables focus and click / keyboard emits.

Slots

NameDescription
avatarReplaces the generated avatar area.
titleReplaces the primary title content.
subtitleReplaces the subtitle content.
descriptionReplaces the supporting description content.
rightRenders actions or trailing metadata on the right side of the top row.

Events

EventParamsDescription
clickMouseEventEmitted from mouse click or Enter when clickable=true and not disabled.