Skip to contentKino
Skip to Content

Aspect ratio

A box that keeps its width to height, for an image, a video or a map. A new ratio glides into place, and a class can change it at a breakpoint.

npx shadcn add https://kinoui.com/r/aspect-ratio.json
Share on

Examples

Mountain peaks above a sea of cloud at sunrise
Sunrise over the Dolomites, from Lucía’s field notes

Default

Give it a ratio, width over height, and size the picture inside to fill it with size-full object-cover.

Cycles

Two-week loops with a burn-up chart built in.
New
12 Nov 2026

In a card

In a Card’s CardSection, the picture runs to the card’s edges and keeps its shape at any width the card takes, so a row of cards lines up.

1 / 1
4 / 3
16 / 9

Ratios

Any ratio, written as width over height. A box taller than the picture crops it with object-cover; use object-contain to show all of it.

Cover shape
Mountain peaks above a sea of cloud at sunrise

Notes from the Dolomites · Draft

Changing

A new ratio glides on the layout role, and what sits below moves with it.

Installation

npx shadcn@latest add https://kinoui.com/r/aspect-ratio.json
Files
lib/reduce-motion.tscomponents/kino/aspect-ratio.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Props

PropTypeDefaultDescription
rationumber1Width over height, such as 16 / 9. Without it, the box reads --ratio from a class, or is square.
renderReactElement(props, state) => ReactElementNoneThe element it renders as, such as a <figure> or an <a>.

CSS variables

VariableSet it onDefaultDescription
--ratioAspectRatio1Its ratio, set by ratio when given. Set it with a class instead to change it at a breakpoint, such as [--ratio:1] @md:[--ratio:16/9].

Accessibility

  • The box itself has no role and isn’t read. Give the image inside an alt that says what it shows, or alt="" when the text beside it already does.
  • With render, it can be the link or figure itself, and that element keeps its own role and focus.
  • Under reduced motion, a new ratio takes its place at once.