-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fixup! fixup! fixup! fixup! Add Menu component
- Loading branch information
1 parent
c5fb425
commit 14234b9
Showing
4 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
app/views/components/examples/menus/horizontal_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Examples | ||
module Menus | ||
class HorizontalComponent < Base | ||
def title | ||
"Horizontal menu" | ||
end | ||
|
||
def example | ||
Menu :horizontal, :base_200 do |menu| | ||
menu.item do | ||
a do | ||
"Item 1" | ||
end | ||
end | ||
|
||
menu.item do | ||
a do | ||
"Item 2" | ||
end | ||
end | ||
|
||
menu.item do | ||
a do | ||
"Item 3" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
45 changes: 45 additions & 0 deletions
45
app/views/components/examples/menus/horizontal_submenu_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module Examples | ||
module Menus | ||
class HorizontalSubmenuComponent < Base | ||
def title | ||
"Horizontal submenu" | ||
end | ||
|
||
def example | ||
Menu :horizontal, :base_200 do |menu| | ||
menu.item do | ||
a do | ||
"Item 1" | ||
end | ||
end | ||
|
||
menu.item do |item| | ||
item.title do | ||
"Parent" | ||
end | ||
|
||
item.submenu do |submenu| | ||
submenu.item do | ||
a do | ||
"Submenu 1" | ||
end | ||
end | ||
|
||
submenu.item do | ||
a do | ||
"Submenu 2" | ||
end | ||
end | ||
end | ||
end | ||
|
||
menu.item do | ||
a do | ||
"Item 3" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
45 changes: 45 additions & 0 deletions
45
app/views/components/examples/menus/mega_menu_with_submenu_responsive_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module Examples | ||
module Menus | ||
class MegaMenuWithSubmenuResponsiveComponent < Base | ||
def title | ||
"Mega menu with submenu (responsive)" | ||
end | ||
|
||
def example | ||
Menu :horizontal, :base_200, xl: :horizontal, class: "rounded-box lg:min-w-max" do |menu| | ||
menu.item do | ||
a do | ||
"Item 1" | ||
end | ||
end | ||
|
||
menu.item do |item| | ||
item.title do | ||
"Parent" | ||
end | ||
|
||
item.submenu do |submenu| | ||
submenu.item do | ||
a do | ||
"Submenu 1" | ||
end | ||
end | ||
|
||
submenu.item do | ||
a do | ||
"Submenu 2" | ||
end | ||
end | ||
end | ||
end | ||
|
||
menu.item do | ||
a do | ||
"Item 3" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters