Git Product home page Git Product logo

Comments (1)

saadeghi avatar saadeghi commented on May 23, 2024

Currently there's a navbar component and it just places items in a row using flexbox. There's also a drawer component which opens an off-canvas sidebar (or shows a fixes sidebar on desktop lg viewport if you want)

One solution might be dynamically changing the style of navbar items into a vertical menu and place them in a drawer.

  • pros:
    • no duplicate HTML for menu items
  • cons:
    • what actually is happening here is transforming one component to another component.
    • there could be anything on a navbar or sidebar drawer. it's not always a simple menu, so it might not the best decision to just put everything from navbar into a vertical drawer for mobile.

The other solution is just having a navbar, hide extra items on mobile resolution. then having a drawer to show the items on mobile. (see example here)

  • pros:
    • there's no limit. you can put anything on your navbar and your drawer. not only a menu.
    • you can control which item should be visible on mobile or desktop (using hidden class)
  • cons:
    • duplicate html for the menu (if you want to show it horizontally on desktop and vertically on mobile)

I'm not strict on this and I'm also looking for the best solution but for now, I think the second solution makes more sense and gives you more control (like this)

from daisyui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.