import * as React from "react"; import {cn} from "@/lib/utilities"; import styles from "./form-skeleton.module.css"; import {Skeleton} from "./skeleton"; /** * Represents the configurable props for the {@link FormSkeleton} component. * * @remarks * Extends native `
` attributes so form-shaped placeholders can be composed into * dialogs, cards, and pages while still supporting accessibility annotations. */ interface FormSkeletonProps extends React.HTMLAttributes { /** * Number of labeled field placeholders rendered before the submit action. * * @default 4 */ fields?: number; } /** * Renders a skeleton placeholder shaped like a labeled form. * * @remarks * **Rendering Context**: Server- and client-compatible presentational component. * * Uses stacked label and input placeholders plus a trailing submit action placeholder to * preserve form layout during async initialization or schema-driven rendering. * * @example * ```tsx * * ``` * * @see {@link FormSkeletonProps} for available props */ const FormSkeleton = React.forwardRef( ({fields = 4, className, ...props}: Readonly, ref): React.JSX.Element => (
{Array.from({length: fields}, (_, index) => (
))}
), ); FormSkeleton.displayName = "FormSkeleton"; export {FormSkeleton}; export type {FormSkeletonProps};