Skip to main content

Card

A general-purpose card container.

Basic usage​

Basic usage
Ink landscape

Distant mountains like indigo, nearby waters veiled in mist.

This is the body area of the card.

Interactive card

When clickable, the whole card carries button semantics and supports Enter / Space activation.

import { LhCard } from '@lh-ui/react'

export default function Demo() {
return (
<LhCard title="Ink landscape" style={{ width: 300 }}>
<p>Distant mountains like indigo, nearby waters veiled in mist.</p>
</LhCard>
)
}

Card Props​

PropDescriptionTypeOptionsDefault
titleTitle (renders the default header when there is no header)string——
shadowWhen to show the shadow'always' | 'hover' | 'never'—'always'
clickableWhole card clickable (carries button keyboard semantics)boolean—false
loadingLoading (skeleton placeholder in the body; the whole card blocks interaction)boolean—false
coverCover areaReactNode——
headerHeader content (overrides the default header)ReactNode——
extraExtra area on the right of the headerReactNode——
footerFooter areaReactNode——
themeVarsComponent-level theme variables, overriding ConfigProviderRecord<string, string>——
bgPatternComponent-level background patternstring——
sxLayout shorthandSxProps——

Card events​

EventDescriptionCallback signatureVue equivalent
onClickFired on click (only when clickable and not loading)(event: MouseEvent) => void@click
Keyboard interaction

When clickable and not loading, the card renders as role="button" and responds to Enter / Space (Space calls preventDefault to avoid scrolling). See Accessibility.

Vue slot mapping

The cover / header / extra / footer slots of plus map to same-named ReactNode props on the React side; the default slot becomes children.

Styles​

import '@lh-ui/react/style/card'