# Aspect ratio: Responsive

> Override the ratio at a breakpoint with an aspect class. This one is square on small screens and `md:aspect-video` from md up.

Example: https://hextaui.com/docs/aspect-ratio/examples/responsive
Component docs: https://hextaui.com/docs/aspect-ratio.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/aspect-ratio-responsive.json
```

This adds `components/examples/aspect-ratio/responsive.tsx` with the Aspect ratio component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/aspect-ratio/responsive.tsx"
import { AspectRatio } from "@/components/ui/aspect-ratio"

export function AspectRatioResponsive() {
  return (
    <div className="w-full max-w-md">
      <AspectRatio ratio={1} className="rounded-lg md:aspect-video">
        <img src="/preview/landscape.svg" alt="Sunset over mountains" />
      </AspectRatio>
    </div>
  )
}
```

## Props in this example

### AspectRatio

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `ratio` | `` number \| `${number}/${number}` \| `${number}:${number}` `` | `1` |  |

## More Aspect ratio examples

- [Ratios](https://hextaui.com/docs/aspect-ratio/examples/ratios.md)
- [Slow load](https://hextaui.com/docs/aspect-ratio/examples/slow-load.md)
- [Broken image](https://hextaui.com/docs/aspect-ratio/examples/broken-image.md)
- [Overlay](https://hextaui.com/docs/aspect-ratio/examples/overlay.md)
- [Without placeholder](https://hextaui.com/docs/aspect-ratio/examples/without-placeholder.md)
- [Inside a centered flex column](https://hextaui.com/docs/aspect-ratio/examples/flex-column.md)
- [Text content](https://hextaui.com/docs/aspect-ratio/examples/text-content.md)
- [As a figure](https://hextaui.com/docs/aspect-ratio/examples/figure.md)
- [Invalid ratio](https://hextaui.com/docs/aspect-ratio/examples/invalid-ratio.md)
- [Right to left](https://hextaui.com/docs/aspect-ratio/examples/rtl.md)
