Shadix.Components.AspectRatio (shadix v0.0.1)

Copy Markdown View Source

Aspect ratio component, translated from the shadcn/ui (new-york-v4) aspect-ratio.

shadcn re-exports Radix's AspectRatio.Root, which carries no Tailwind classes of its own. This presentational version renders a <div data-slot="aspect-ratio"> and applies the ratio via the CSS aspect-ratio property.

Summary

Functions

aspect_ratio(assigns)

Attributes

  • ratio (:string) - Defaults to "1 / 1".
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)