Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header and Sidebar Layouts not working #1378

Closed
3 tasks done
bridgeyuwa opened this issue Mar 24, 2025 · 3 comments
Closed
3 tasks done

Header and Sidebar Layouts not working #1378

bridgeyuwa opened this issue Mar 24, 2025 · 3 comments

Comments

@bridgeyuwa
Copy link

Flux version

v2.1.1

Livewire version

v3.6.2

Tailwind version

v4.0.x

Browser and Operating System

Chrome on Windows

What is the problem?

Affected Layouts:

Issues:

  • Menu doesn't work on mobile for both layouts.
  • In the Sidebar Layout, the menu doesn’t display at all on desktop.

Code snippets

    <!-- Styles / Scripts -->
     @vite(['resources/css/app.css', 'resources/js/app.js'])
     @fluxAppearance
</head>
    <flux:brand href="#" logo="https://fluxui.dev/img/demo/logo.png" name="Acme Inc." class="max-lg:hidden dark:hidden" />
    <flux:brand href="#" logo="https://fluxui.dev/img/demo/dark-mode-logo.png" name="Acme Inc." class="max-lg:hidden! hidden dark:flex" />

    <flux:navbar class="-mb-px max-lg:hidden">
        <flux:navbar.item icon="home" href="#" current>Home</flux:navbar.item>
        <flux:navbar.item icon="inbox" badge="12" href="#">Inbox</flux:navbar.item>
        <flux:navbar.item icon="document-text" href="#">Documents</flux:navbar.item>
        <flux:navbar.item icon="calendar" href="#">Calendar</flux:navbar.item>

        <flux:separator vertical variant="subtle" class="my-2"/>

        <flux:dropdown class="max-lg:hidden">
            <flux:navbar.item icon:trailing="chevron-down">Favorites</flux:navbar.item>

            <flux:navmenu>
                <flux:navmenu.item href="#">Marketing site</flux:navmenu.item>
                <flux:navmenu.item href="#">Android app</flux:navmenu.item>
                <flux:navmenu.item href="#">Brand guidelines</flux:navmenu.item>
            </flux:navmenu>
        </flux:dropdown>
    </flux:navbar>

    <flux:spacer />

    <flux:navbar class="me-4">
        <flux:navbar.item icon="magnifying-glass" href="#" label="Search" />
        <flux:navbar.item class="max-lg:hidden" icon="cog-6-tooth" href="#" label="Settings" />
        <flux:navbar.item class="max-lg:hidden" icon="information-circle" href="#" label="Help" />
    </flux:navbar>

    <flux:dropdown position="top" align="start">
        <flux:profile avatar="https://fluxui.dev/img/demo/user.png" />

        <flux:menu>
            <flux:menu.radio.group>
                <flux:menu.radio checked>Olivia Martin</flux:menu.radio>
                <flux:menu.radio>Truly Delta</flux:menu.radio>
            </flux:menu.radio.group>

            <flux:menu.separator />

            <flux:menu.item icon="arrow-right-start-on-rectangle">Logout</flux:menu.item>
        </flux:menu>
    </flux:dropdown>
</flux:header>

<flux:sidebar stashable sticky class="lg:hidden bg-zinc-50 dark:bg-zinc-900 border rtl:border-r-0 rtl:border-l border-zinc-200 dark:border-zinc-700">
    <flux:sidebar.toggle class="lg:hidden" icon="x-mark" />

    <flux:brand href="#" logo="https://fluxui.dev/img/demo/logo.png" name="Acme Inc." class="px-2 dark:hidden" />
    <flux:brand href="#" logo="https://fluxui.dev/img/demo/dark-mode-logo.png" name="Acme Inc." class="px-2 hidden dark:flex" />

    <flux:navlist variant="outline">
        <flux:navlist.item icon="home" href="#" current>Home</flux:navlist.item>
        <flux:navlist.item icon="inbox" badge="12" href="#">Inbox</flux:navlist.item>
        <flux:navlist.item icon="document-text" href="#">Documents</flux:navlist.item>
        <flux:navlist.item icon="calendar" href="#">Calendar</flux:navlist.item>

        <flux:navlist.group expandable heading="Favorites" class="max-lg:hidden">
            <flux:navlist.item href="#">Marketing site</flux:navlist.item>
            <flux:navlist.item href="#">Android app</flux:navlist.item>
            <flux:navlist.item href="#">Brand guidelines</flux:navlist.item>
        </flux:navlist.group>
    </flux:navlist>

    <flux:spacer />

    <flux:navlist variant="outline">
        <flux:navlist.item icon="cog-6-tooth" href="#">Settings</flux:navlist.item>
        <flux:navlist.item icon="information-circle" href="#">Help</flux:navlist.item>
    </flux:navlist>
</flux:sidebar>

<flux:main container>
    <flux:heading size="xl" level="1">Good afternoon, Olivia</flux:heading>

    <flux:text class="mt-2 mb-6 text-base">Here's what's new today</flux:text>

    <flux:separator variant="subtle" />
</flux:main>

@fluxScripts

How do you expect it to work?

How it does in the docs example

Please confirm (incomplete submissions will not be addressed)

  • I have provided easy and step-by-step instructions to reproduce the bug.
  • I have provided code samples as text and NOT images.
  • I understand my bug report will be closed if I haven't met the criteria above.
@joshhanley
Copy link
Member

joshhanley commented Mar 24, 2025

@bridgeyuwa thanks for reporting! Can you please provide some screenshots so we can see what you’re seeing? Thanks!

@bridgeyuwa
Copy link
Author

bridgeyuwa commented Mar 24, 2025

@joshhanley here they are, both layouts on desktop and on mobile view.

Sidebar Layout on Desktop
Image

Sidebar Layout on Mobile
Image

Sidebar Layout on Mobile (Menu Clicked)
Image

For the Header Layout. It works as intended on Desktop but shows and behaves on mobile the same as the sidebar layout screenshots above.

@joshhanley
Copy link
Member

@bridgeyuwa thanks! I just tested your code and it all works as expected for me. I suspect the issue that you are running into was an issue with a specific version of Tailwind, but I can't confirm as you didn't fill in the exact Tailwind version number (4.0.x). To view your exact version run npm list. Make sure you are on at least v4.0.12. I'm going to close this as I don't believe it's an issue with Flux. If you're still having trouble, please comment back here and we can investigate. Please include the output of npm list and your app.css. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants