2022-01-12 10:27:49 +00:00
|
|
|
package dev.inmo.jsuikit.elements
|
2021-12-22 08:38:12 +00:00
|
|
|
|
|
|
|
import androidx.compose.runtime.Composable
|
2022-01-12 13:58:52 +00:00
|
|
|
import dev.inmo.jsuikit.modifiers.UIKitModifier
|
|
|
|
import dev.inmo.jsuikit.modifiers.include
|
2022-01-13 05:55:08 +00:00
|
|
|
import org.jetbrains.compose.web.dom.*
|
|
|
|
import org.w3c.dom.HTMLElement
|
2021-12-22 08:38:12 +00:00
|
|
|
|
|
|
|
@Composable
|
|
|
|
fun Navbar(
|
|
|
|
leftBuilder: NavbarNavBuilder? = null,
|
|
|
|
centerBuilder: NavbarNavBuilder? = null,
|
|
|
|
rightBuilder: NavbarNavBuilder? = null,
|
2022-01-13 13:56:39 +00:00
|
|
|
vararg navModifiers: UIKitModifier,
|
2022-01-13 05:55:08 +00:00
|
|
|
attributesCustomizer: AttrBuilderContext<HTMLElement> = {},
|
2021-12-22 08:38:12 +00:00
|
|
|
) {
|
|
|
|
Nav(
|
|
|
|
{
|
|
|
|
attr("uk-navbar", "")
|
|
|
|
classes("uk-navbar-container", "uk-navbar")
|
|
|
|
include(*navModifiers)
|
2022-01-13 05:55:08 +00:00
|
|
|
attributesCustomizer()
|
2021-12-22 08:38:12 +00:00
|
|
|
}
|
|
|
|
) {
|
|
|
|
leftBuilder ?.let {
|
|
|
|
Div({ classes("uk-navbar-left") }) { it.draw() }
|
|
|
|
}
|
|
|
|
centerBuilder ?.let {
|
|
|
|
Div({ classes("uk-navbar-center") }) { it.draw() }
|
|
|
|
}
|
|
|
|
rightBuilder ?.let {
|
|
|
|
Div({ classes("uk-navbar-right") }) { it.draw() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|