// To precisely match the DaisyUI example's visual layout, we replicate its
// flexbox structure inside the NavbarEnd instead of using a semantic Menu.
Navbar(
style: [BgUtil.base200, Spacing.mb40],
ariaLabel: 'Navbar with dropdown example',
[
NavbarStart([
Button([text('daisyUI')], style: [Button.ghost], classes: 'text-lg font-bold'),
]),
NavbarEnd([
// A container to replicate `<div class="flex items-stretch">`
Container(
style: [Layout.flex, Alignment.itemsStretch],
[
Button([text('Button')], style: [Button.ghost], classes: 'rounded-field'),
Dropdown(
method: DropdownMethod.focus,
style: [Dropdown.end],
// The trigger is a focusable Container styled as a button
trigger: Container(
[text('Dropdown')],
tag: 'div',
attributes: {'tabindex': '0', 'role': 'button'},
classes: 'btn btn-ghost rounded-field',
),
content: DropdownContent(
[
MenuItem([text('Item 1')]),
MenuItem([text('Item 2')]),
],
tag: 'ul',
style: [
DropdownContent.menu,
Spacing.p(2),
Effects.shadowSm,
BgUtil.base200,
Effects.roundedBox,
Size.w(52),
Spacing.mt(4),
Layout.z(1),
],
),
),
],
),
]),
],
)