Class: Daisy::Mockup::BrowserComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::Mockup::BrowserComponent
- Defined in:
- app/components/daisy/mockup/browser_component.rb
Overview
The BrowserComponent creates a realistic browser window mockup, perfect for:
-
Showcasing web applications.
-
Creating website previews.
-
Demonstrating responsive designs.
-
Building marketing materials.
The component includes an optional toolbar for URL input and browser controls, and a content area that can contain any content you wish to display.
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
-
#before_render ⇒ Object
Sets up the component’s CSS classes.
-
#call ⇒ Object
Renders the toolbar (if present) and content.
-
#initialize(**kws) ⇒ BrowserComponent
constructor
Creates a new Browser component.
Methods inherited from LocoMotion::BaseComponent
build, #component_ref, #config_option, #cssify, define_modifier, define_modifiers, define_part, define_parts, define_size, define_sizes, #empty_part_content, #inspect, #part, register_component_initializer, register_component_setup, #rendered_css, #rendered_data, #rendered_html, #rendered_stimulus_controllers, #rendered_tag_name, renders_many, renders_one, set_component_name, #set_loco_parent, #strip_spaces
Constructor Details
#initialize(**kws) ⇒ BrowserComponent
Creates a new Browser component.
57 58 59 |
# File 'app/components/daisy/mockup/browser_component.rb', line 57 def initialize(**kws) super(**kws) end |
Instance Method Details
#before_render ⇒ Object
Sets up the component’s CSS classes.
64 65 66 |
# File 'app/components/daisy/mockup/browser_component.rb', line 64 def before_render add_css(:component, "mockup-browser") end |
#call ⇒ Object
Renders the toolbar (if present) and content.
71 72 73 74 75 76 |
# File 'app/components/daisy/mockup/browser_component.rb', line 71 def call part(:component) do concat() if concat(content) end end |