Swipe through Lovelace views on mobile.
- Animated swiping through Lovelace views.
- Configure views to skip over.
- Set the swipe length needed.
- Option to disable a browsers default swipe actions.
- Wrap from first view to last view and vice versa.
- Support RTL languages.
Follow only one of these installation methods.
Installation and tracking with HACS:
-
In "store" search for lovelace-swipe-navigation and install.
-
Refresh the Lovelace page.
Manual installation:
-
Copy
swipe-navigation.js
into/www/lovelace-swipe-navigation/
-
Add the resource in
ui-lovelace.yaml
or in Lovelace Resources.
resources:
# increase this version number at end of URL after each update
- url: /local/lovelace-swipe-navigation/swipe-navigation.js?v=1.0.0
type: module
- Refresh the page.
Configuration is done in the root of your lovelace configuration.
Example:
swipe_nav:
wrap: false
animate: swipe
skip_tabs: 5,6,7,8
prevent_default: true
swipe_amount: 30
views:
Config Options:
Name | Type | Default | Description |
---|---|---|---|
swipe_amount | number | 15 | Minimum percent of screen needed to be swiped in order to navigate. |
skip_tabs | string | A comma seperated list of views to skip when swiping. e.g., 1,3,5 . |
|
skip_hidden | boolean | true | Automatically skips hidden tabs. |
wrap | boolean | true | Wrap from first tab to last tab and vice versa. |
prevent_default | boolean | false | Prevents the browsers default horizontal swipe actions. |
animate | string | Swipe animations. Can be: swipe , fade , flip . The swipe animation should be considered experimental and depending on your setup may appear buggy. |
Big thanks to:
- @themoffatt for the original idea
- @RomRider and his decluttering-card for the configuration method.