Class: Irelia::Dropdown::Preview
- Inherits:
-
ComponentPreview
- Object
- ComponentPreview
- Irelia::Dropdown::Preview
- Defined in:
- app/components/irelia/dropdown/preview.rb
Instance Method Summary collapse
-
#default ⇒ Object
You can specify the container class for the default template self.container_class = “w-1/2 border border-gray-300”.
- #direction_up ⇒ Object
- #icons_left ⇒ Object
- #icons_right ⇒ Object
Instance Method Details
#default ⇒ Object
You can specify the container class for the default template self.container_class = “w-1/2 border border-gray-300”
7 8 9 10 11 12 13 14 15 |
# File 'app/components/irelia/dropdown/preview.rb', line 7 def default irelia_dropdown(open: true) do |dropdown| dropdown.with_trigger(size: :sm, icon: "fas fa-gear") dropdown.with_item { "Profile" } dropdown.with_item { "Settings" } dropdown.with_item { "Switch account" } dropdown.with_item { "Sign out" } end end |
#direction_up ⇒ Object
40 41 |
# File 'app/components/irelia/dropdown/preview.rb', line 40 def direction_up end |
#icons_left ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/components/irelia/dropdown/preview.rb', line 18 def icons_left irelia_dropdown(open: true) do |dropdown| dropdown.with_trigger(size: :sm, icon: "fas fa-gear") dropdown.with_item(icon: "fas fa-user") { "Profile" } dropdown.with_item(icon: "fas fa-gear") { "Settings" } dropdown.with_item(icon: "fas fa-users") { "Switch account" } dropdown.with_item(icon: "fas fa-right-from-bracket") { "Sign out" } end end |
#icons_right ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'app/components/irelia/dropdown/preview.rb', line 29 def icons_right irelia_dropdown(open: true) do |dropdown| dropdown.with_trigger(size: :sm, icon: "fas fa-gear") dropdown.with_item(right_icon: "fas fa-user") { "Profile" } dropdown.with_item(right_icon: "fas fa-gear") { "Settings" } dropdown.with_item(right_icon: "fas fa-users") { "Switch account" } dropdown.with_item(right_icon: "fas fa-right-from-bracket") { "Sign out" } end end |