import { type HTMLAttributes, type ReactElement, type Ref } from "react"; import { Box } from "../box/Box.js"; import { type BoxAlignItems, type BoxOptions } from "../box/styles.js"; import { type CardClassNameOptions, card } from "./styles.js"; /** * @since 6.0.0 Extends the {@link CardClassNameOptions} and removed the * deprecated `raiseable` prop */ export interface CardProps extends HTMLAttributes, CardClassNameOptions, Pick { ref?: Ref; /** @defaultValue `"stretch"` */ align?: BoxAlignItems; /** @defaultValue `"start"` */ justify?: BoxAlignItems; } /** * @example Simple Example * ```tsx * import { Button } from "@react-md/core/button/Button"; * import { Card } from "@react-md/core/card/Card"; * import { CardContent } from "@react-md/core/card/CardContent"; * import { CardFooter } from "@react-md/core/card/CardFooter"; * import { CardHeader } from "@react-md/core/card/CardHeader"; * import { CardTitle } from "@react-md/core/card/CardTitle"; * import { CardSubtitle } from "@react-md/core/card/CardSubtitle"; * import { Typography } from "@react-md/core/typography/Typography"; * import type { ReactElement } from "react"; * * function Example(): ReactElement { * return ( * * * Main Title * A subtitle * * * * Some paragraph of text. * * * * * * * * ); * } * ``` * * @see {@link https://react-md.dev/components/card | Card Demos} * @since 6.0.0 Removed the deprecated `raiseable` prop * @since 6.0.0 Uses the `Box` component and displays as `flex` instead of * `block`/`inline-block`. */ export function Card(props: CardProps): ReactElement { const { ref, children, className, align = "stretch", justify = "stretch", bordered, raisable, interactable, ...remaining } = props; return ( {children} ); }