Class: Shadcn::AspectRatioComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::AspectRatioComponent
- Defined in:
- app/components/shadcn/aspect_ratio_component.rb
Overview
Aspect Ratio component for maintaining content proportions Matches shadcn/ui AspectRatio component
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
-
#initialize(ratio: 1, **options) ⇒ AspectRatioComponent
constructor
A new instance of AspectRatioComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(ratio: 1, **options) ⇒ AspectRatioComponent
Returns a new instance of AspectRatioComponent.
19 20 21 22 |
# File 'app/components/shadcn/aspect_ratio_component.rb', line 19 def initialize(ratio: 1, **) super(**) @ratio = ratio.to_f end |