Coder Social home page Coder Social logo

Comments (3)

appreciated avatar appreciated commented on August 17, 2024

Hello Borax I don't know how much of the API you already have discovered and if you found the following method.

public class DemoUI extends UI {
  ...
  protected void init(VaadinRequest request) {
    setContent(NavigationDrawerBuilder.get()
    .withVariant( ... ) // <-- this one
    .build());
  }
}

And if one of the offered Variants satisfy you.

Now to your question:

I do not recommend removing the app bar from because from a UX point of view, about no user will be able to figure out how to open the drawer if you remove the AppBar.

But If you really want no app bar 😉 yes it is possible to do so:

1. You could either use the variant LEFT or LEFT_OVERLAY and hide the App Bar by setting some scss variables and applying some styles in a custom theme:

$app-bar-height: 0px;
$app-bar-shadow: none;

@import ...

@mixin mytheme {
   ...
   app-toolbar {
     display: none;
   }
  ...
}

2. (This requires more work but is a cleaner solution) Or create your own Custom Layout and use your own template.

Checkout the package com.github.appreciated.app.layout.drawer, the associated Resource folder and /webapp/VAADIN/addons/app-layout figure out how I made polymer app-layout working and try to mimic it and make only app-drawer work. It is actually not that complicated than it may sounds. The Examples are very straight forward.

from vaadin-app-layout.

bora-aydemir avatar bora-aydemir commented on August 17, 2024

Thanks, I'll look into it. You are correct about the appbar, but my problem is that I already have one in my project :) I just need a drawer that will play nice with my appbar.

from vaadin-app-layout.

appreciated avatar appreciated commented on August 17, 2024

@borax1974 Ah yeah you are right didn't think about that usecase 🙂 you then might want to add a button to that app-bar which calls the following then the UX does not suffer

AbstractNavigationDrawer::toggleDrawer()

from vaadin-app-layout.

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.