Hi,
I wanted a smaller than the default switch widget, which aligns better with the default slider widget
uid: horizontal_switch
props:
parameters:
- label: Title
name: switchTitle
required: false
type: TEXT
- label: Footer Text
name: switchFooter
required: false
type: TEXT
- context: item
description: An item to control
label: Item
name: switchItem
required: false
type: TEXT
timestamp: Jan 6, 2021, 10:49:31 AM
component: f7-card
config:
title: '=(props.switchTitle) ? props.switchTitle : (props.switchItem) ? props.switchItem : ""'
slots:
default:
- component: f7-card-content
config:
class:
- display-flex
- justify-content-flex-end
slots:
default:
- component: oh-icon
config:
icon: '=items[props.switchItem].state == "ON" ? "switch-on" : "switch-off"'
style:
position: absolute
left: calc(1em)
top: 1em
width: 30px
- component: oh-toggle
config:
item: =props.switchItem
- component: f7-card-footer
config:
visible: "=(props.switchFooter) ? true : false"
slots:
default:
- component: Label
config:
text: '=(props.switchFooter) ? props.switchFooter : ""'
Note there is still an issue with the footer, as it is getting some more white space below the text than I wish for… haven’t found a way to remove that. Maybe @ysc has a hint on that Anyway sharing it so it might be useful for someone else as well. fixed… thanks for the tip @RGroll now it got it to align including the (optional) footer