# Card: Media

> An image, video, picture or aspect ratio placed first or last runs edge to edge. The card drops the padding on that side and clips the media to its corners.

Example: https://hextaui.com/docs/card/examples/media
Component docs: https://hextaui.com/docs/card.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/card-media.json
```

This adds `components/examples/card/media.tsx` with the Card component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/card/media.tsx"
import {
  Card,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

export function CardMedia() {
  return (
    <div className="grid w-full gap-4 sm:grid-cols-2">
      <Card>
        <img
          src="/preview/landscape.svg"
          alt="Mountain landscape"
          className="aspect-video w-full object-cover"
        />
        <CardHeader>
          <CardTitle>Media first</CardTitle>
          <CardDescription>
            The image runs edge to edge and inherits the card corners.
          </CardDescription>
        </CardHeader>
      </Card>
      <Card>
        <CardHeader>
          <CardTitle>Media last</CardTitle>
          <CardDescription>Bottom padding drops for the image.</CardDescription>
        </CardHeader>
        <img
          src="/preview/landscape.svg"
          alt="Mountain landscape"
          className="aspect-video w-full object-cover"
        />
      </Card>
    </div>
  )
}
```

## More Card examples

- [Variants](https://hextaui.com/docs/card/examples/variants.md)
- [Sizes](https://hextaui.com/docs/card/examples/sizes.md)
- [Clickable card](https://hextaui.com/docs/card/examples/link.md)
- [Clickable variants](https://hextaui.com/docs/card/examples/link-variants.md)
- [Borders](https://hextaui.com/docs/card/examples/borders.md)
- [Nested](https://hextaui.com/docs/card/examples/nested.md)
- [Long content](https://hextaui.com/docs/card/examples/long-content.md)
- [Semantics](https://hextaui.com/docs/card/examples/semantics.md)
- [Right to left](https://hextaui.com/docs/card/examples/rtl.md)
