Giter VIP home page Giter VIP logo

ha-navbar-position's Introduction

Navbar Position

A Home Assistant frontend plugin that allows the navigation bar to be moved to the bottom of the screen.

Note: This repo has been updated to work with HA versions > 2023.04, it will not work on anything lower, please keep this in mind if you open an issue and are using an older version.

screenshot

Installation

Install via HACS by searching for "Navbar Position".

Or install manually by dropping ha-navbar-position.js into your Lovelace dashboard resources.

Usage

Via the URL

The primary way this plugin is activated is by adding navbar=bottom to the dashboard URL, like so:

http://<hass>:8123/some-dashboard/some-view?navbar=bottom

The navigation bar will be moved to the bottom of the screen until the next page refresh.

To save the navigation bar position to localStorage and move the navbar to the bottom automatically without having to specify navbar=bottom every time, use navbar_cache:

http://<hass>:8123/some-dashboard/some-view?navbar=bottom&navbar_cache

Thereafter, page loads that don't specify any navbar query parameters will default to moving the navbar to the bottom.

To clear the saved position and return the navbar to the top on future page loads, use navbar_cache without navbar=...:

http://<hass>:8123/some-dashboard/some-view?navbar_cache

There will likely be additional ways to configure this plugin in the future - pull requests gladly accepted.

Via custom card

For scenarios where it isn't possible to edit the URL directly (e.g. when using the Home Assistant mobile apps), you can toggle the navigation bar position on a per-device basis using the Navbar Position Configuration Card custom card.

Add it to a dashboard of your choosing, then click the card's "toggle navigation bar position" button on any device where you want to move the navbar to the bottom of the screen. The button will save the change to localStorage; you can then get rid of the card and the navbar will continue to show up at the bottom of the screen on the device in question.

Limitations

The page is scanned every second to see if the header has appeared or has been replaced. This means that while switching between views within a single dashboard leaves the navbar at the bottom, switching between dashboards or other pages in the Home Assistant UI will cause the navbar to jump back to the top for ~1 second when you return to a dashboard. PRs gladly accepted to sprinkle some more MutationObservers around to get rid of that delay.

This also only moves the dashboard navigation bar; it doesn't move navigation bars associated with any other screens. PRs welcome to handle that as well.

ha-navbar-position's People

Contributors

javawizard avatar greenphlem avatar

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.