byronwade/ui
Application UI

Data display · Application UI

Aspect Ratio

Container that locks child content to a fixed width-to-height ratio via CSS custom property.

@byronwade/foundation@byronwade/utils

Feature showcase

Installation

Features

  • 5 examples

    Default, Square, Portrait, Cinematic, Thumbnail.

API

Props

PropTypeDefaultDescription
rationumber-Width divided by height (e.g. 16/9, 1, 4/3).
classNamestring-Additional classes merged onto the root.

Dependencies

PackageKindDescription
@byronwade/foundationregistryInstalled through the byronwade/ui registry.
@byronwade/utilsregistryInstalled through the byronwade/ui registry.

Source and related

FilePath
Componentregistry/ui/aspect-ratio.tsx
Default examplecontent/examples/aspect-ratio/default.tsx
Square examplecontent/examples/aspect-ratio/square.tsx
Portrait examplecontent/examples/aspect-ratio/portrait.tsx
Cinematic examplecontent/examples/aspect-ratio/cinematic.tsx
Thumbnail examplecontent/examples/aspect-ratio/thumbnail.tsx