Skip to main content
Version: Next

AspectRatio API

import { AspectRatio } from '@editora/ui-react';

Props​

PropTypeDescription
elevation'none' | 'low' | 'high'
fit'cover' | 'contain' | 'fill' | 'none' | 'scale-down'
headlessboolean
interactiveboolean
radiusnumber | string
rationumber | string
showRatioBadgeboolean
size'sm' | 'md' | 'lg' | '1' | '2' | '3'
tone'neutral' | 'info' | 'success' | 'warning' | 'danger'
variant'surface' | 'soft' | 'outline' | 'solid'

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Element: <ui-aspect-ratio>​

AspectRatio renders the ui-aspect-ratio custom element from @editora/ui-core, which can also be used without React.

Attributes: elevation, fit, headless, interactive, radius, ratio, show-ratio-badge, size, tone, variant

Events: change, resize