-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ea6b65
commit 3d98c89
Showing
2 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
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
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,73 @@ | ||
package navbars | ||
|
||
import htmx "github.com/zeiss/fiber-htmx" | ||
|
||
// NavbarProps are the properties of the Navbar component | ||
type NavbarProps struct { | ||
ClassNames htmx.ClassNames | ||
} | ||
|
||
// Navbar represents a Daisy UI Navbar component. | ||
// see: https://daisyui.com/components/navbar | ||
func Navbar(props NavbarProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.Merge( | ||
htmx.ClassNames{ | ||
"navbar": true, | ||
"bg-base-100": true, | ||
}, | ||
), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// NavbarStartProps represents the properties of the NavbarStart component | ||
type NavbarStartProps struct { | ||
ClassNames htmx.ClassNames | ||
} | ||
|
||
// NavbarStart represents a Daisy UI NavbarStart component. | ||
func NavbarStart(props NavbarStartProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.Merge( | ||
htmx.ClassNames{ | ||
"navbar-start": true, | ||
}, | ||
), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// NavbarCenterProps are the properties of the NavbarCenter component | ||
type NavbarCenterProps struct { | ||
ClassNames htmx.ClassNames | ||
} | ||
|
||
// NavbarCenter represents a Daisy UI NavbarCenter component. | ||
func NavbarCenter(props NavbarCenterProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.Merge( | ||
htmx.ClassNames{ | ||
"navbar-center": true, | ||
}, | ||
), | ||
htmx.Group(children...), | ||
) | ||
} | ||
|
||
// NavbarEndProps are the properties of the NavbarEnd component | ||
type NavbarEndProps struct { | ||
ClassNames htmx.ClassNames | ||
} | ||
|
||
// NavbarEnd represents a Daisy UI NavbarEnd component. | ||
func NavbarEnd(props NavbarEndProps, children ...htmx.Node) htmx.Node { | ||
return htmx.Div( | ||
htmx.Merge( | ||
htmx.ClassNames{ | ||
"navbar-end": true, | ||
}, | ||
), | ||
htmx.Group(children...), | ||
) | ||
} |