Class: Fluxbit::Form::DropzoneComponent
- Inherits:
-
FieldComponent
- Object
- FieldComponent
- Fluxbit::Form::DropzoneComponent
- Includes:
- Config::Form::DropzoneComponent
- Defined in:
- app/components/fluxbit/form/dropzone_component.rb
Overview
The ‘Fluxbit::Form::DropzoneComponent` provides a drag-and-drop file input zone with support for labels, titles, subtitles, icons, validation states, and integration with Rails form builders. It renders a visually rich area that lets users drag files or click to select a file, and is fully customizable via its options and slot for custom content.
Instance Method Summary collapse
- #create_icon ⇒ Object
-
#initialize(**props) ⇒ DropzoneComponent
constructor
Initializes the dropzone component with the given properties.
Constructor Details
#initialize(**props) ⇒ DropzoneComponent
Initializes the dropzone component with the given properties.
26 27 28 29 30 31 32 33 34 |
# File 'app/components/fluxbit/form/dropzone_component.rb', line 26 def initialize(**props) super(**props) @title = (@props.delete(:title), default: true) @subtitle = (@props.delete(:subtitle), default: true) @icon = @props.delete(:icon) || @@icon @icon_props = @props.delete(:icon_props) || { class: styles[:icon] } @height = @props.delete(:height) || @@height add to: @props, class: "hidden" end |
Instance Method Details
#create_icon ⇒ Object
36 37 38 |
# File 'app/components/fluxbit/form/dropzone_component.rb', line 36 def create_icon anyicon(icon: @icon, class: styles[:icon]) end |