mirror of
https://github.com/tabler/tabler.git
synced 2026-08-29 13:21:29 +04:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
26 lines
844 B
Plaintext
26 lines
844 B
Plaintext
---
|
|
import type { HTMLTag } from 'astro/types'
|
|
|
|
// Composable card container (.card). For the fixed demo-showcase card see ../cards/Card.astro.
|
|
|
|
// `as` must stay out of the Props body: Astro's frontmatter scanner bails on a member
|
|
// literally named `as` and silently falls back to untyped props.
|
|
type PolymorphicProps = { as?: HTMLTag }
|
|
|
|
/** core/scss/ui/_cards.scss `.card-{size}` body padding modifier classes */
|
|
type CardSize = 'sm' | 'md' | 'lg'
|
|
|
|
interface Props extends PolymorphicProps {
|
|
size?: CardSize | undefined
|
|
class?: string
|
|
/** remaining attributes (id, action, data-*, …) are forwarded to the element */
|
|
[key: string]: unknown
|
|
}
|
|
|
|
const { as: Element = 'div', size, class: className, ...rest }: Props = Astro.props
|
|
---
|
|
|
|
<Element class:list={['card', size && `card-${size}`, className]} {...rest}>
|
|
<slot />
|
|
</Element>
|