import * as React from "react"; import {cn} from "@/lib/utilities"; import styles from "./card-skeleton.module.css"; import {Skeleton} from "./skeleton"; /** * Represents the configurable props for the {@link CardSkeleton} component. * * @remarks * Extends native `
` attributes so card-shaped loading placeholders can be composed * in semantic regions, annotated for accessibility, and sized with custom class names. */ interface CardSkeletonProps extends React.HTMLAttributes { /** * Number of body placeholder lines rendered in the card content area. * * @default 3 */ lines?: number; } /** * Renders a skeleton placeholder shaped like a card surface. * * @remarks * **Rendering Context**: Server- and client-compatible presentational component. * * Mimics the visual structure of the library's card primitive with a header, stacked * content lines, and a trailing footer action placeholder to reduce layout shift while * data-backed card content is loading. * * @example * ```tsx * * ``` * * @see {@link CardSkeletonProps} for available props */ const CardSkeleton = React.forwardRef( ({lines = 3, className, ...props}: Readonly, ref): React.JSX.Element => (
{Array.from({length: lines}, (_, index) => ( ))}
), ); CardSkeleton.displayName = "CardSkeleton"; export {CardSkeleton}; export type {CardSkeletonProps};