Class: Daisy::Layout::AuraComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::Layout::AuraComponent
- Includes:
- LocoMotion::Concerns::LinkableComponent
- Defined in:
- app/components/daisy/layout/aura_component.rb
Overview
The glow is drawn with blurred pseudo-elements that extend slightly
outside the wrapper, so avoid overflow-hidden on the aura itself (or on
a tight parent) or the glow will be clipped.
Inside a column flex container (e.g. a card body on small screens),
the wrapper is stretched to the parent's full width by the default
align-items: stretch, painting the aura far beyond its content. Add
w-fit (or an appropriate self-* utility) to keep the aura sized to
its content.
The AuraComponent wraps any content with the DaisyUI aura effect — an
animated border light that rotates around the element. Common use cases
include:
- Highlighting a call-to-action button.
- Drawing attention to a featured card or pricing section.
- Adding a subtle glow to avatars or badges.
The effect is pure CSS: the wrapper paints a rotating conic gradient behind
your content (plus two blurred copies for the glow), so no JavaScript is
required. The gradient uses currentColor, which means the aura color is
simply the wrapper's text color — set it with any Tailwind text-* utility.
Includes the LocoMotion::Concerns::LinkableComponent module so that
providing an href: will render the wrapper as an <a> tag, making the
entire aura-wrapped element clickable.
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.
-
#initialize(*args, **kws, &block) ⇒ AuraComponent
constructor
Creates a new Aura 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
Methods included from LocoMotion::Concerns::InspectableComponent
Constructor Details
#initialize(*args, **kws, &block) ⇒ AuraComponent
Creates a new Aura component.
98 99 100 |
# File 'app/components/daisy/layout/aura_component.rb', line 98 def initialize(*args, **kws, &block) super end |
Instance Method Details
#before_render ⇒ Object
Sets up the component's CSS classes.
105 106 107 108 |
# File 'app/components/daisy/layout/aura_component.rb', line 105 def before_render setup_component super end |