new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Radix Primitives · all subjects

aspect-ratio

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

AspectRatio.Root component anatomy

AspectRatio.Root is the main component that contains content you want to constrain to a given ratio. Import it from 'radix-ui' as: import { AspectRatio } from "radix-ui";

AspectRatio.Root asChild prop

AspectRatio.Root accepts an 'asChild' prop of type boolean with default value false. When true, it changes the default rendered element for the one passed as a child, merging their props and behavior. See the Composition guide for more details.

AspectRatio.Root ratio prop

AspectRatio.Root accepts a 'ratio' prop of type number with default value 1. This prop specifies the desired ratio for constraining the content.

AspectRatio accepts custom ratios

AspectRatio can accept any custom ratio value through the ratio prop.

AspectRatio component basic usage

The AspectRatio component wraps content and maintains a desired aspect ratio. It accepts a ratio prop as a number (e.g., 16 / 8 for a 2:1 ratio). Child elements can be styled to fill the container using objectFit: 'cover', width: '100%', and height: '100%'.

AspectRatio ratio prop

AspectRatio accepts a ratio prop that specifies the desired aspect ratio as a number. For example, ratio={16 / 8} creates a 2:1 aspect ratio.

AspectRatio inherits from primitive

AspectRatio component inherits props from the Aspect Ratio primitive component. For full API details, see the primitive documentation.

Give your agent this brain