ValyroUI Русская версия

Aspect Ratio Picker

Aspect ratio and exact size. Pro · Image generation › Prompt and settings

Visual ratio tiles plus exact width × height with ratio lock, orientation swap and snapping.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add aspect-ratio-picker
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { AspectRatioPicker } from 'valyro-ui-pro';

Props

PropTypeDefault
valueImageSizeControlled value; use with onValueChange.
defaultValueImageSizeInitial value when uncontrolled.
onValueChange(size: ImageSize) => voidCalled with the new value when it changes.
ratiosreadonly AspectRatio[]DEFAULT_ASPECT_RATIOSRatio tiles. Default 1:1, 4:3, 3:2, 16:9, 21:9, 3:4, 2:3, 9:16.
baseSizenumber1024A tile maps to about baseSize² pixels: 1024 for SDXL / Flux, 512 for SD 1.5. Default 1024.
multiplenumberSizes snap to this multiple (8 for latent space, 64 for most models).
defaultMultiplenumber64Initial multiple when uncontrolled.
onMultipleChange(multiple: number) => voidCalled with the new multiple when it changes.
multiplesreadonly number[][8, 64]Choices for the snap toggle; one value hides it. Default [8, 64].
minnumber256Smallest width or height, px; tiles and typed sizes are clamped to it.
maxnumber2048Largest width or height, px; tiles and typed sizes are clamped to it.
custombooleantrueWidth × height fields with ratio lock and swap. Default true.
size'sm' | 'md''md'Ratio tile size and spacing.
fieldSize'sm' | 'md'sizeHeight of the width × height fields: sm is 32 px, to match other small controls in a sidebar. Defaults to size.
disabledbooleanfalseDisables the tiles, size fields, lock, swap and snap toggle.
localestringBCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's.
labelsPartial<AspectRatioPickerLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Generation Settings · Next: Seed Input · All Image generation