Widget use in widget alignment

I’m using some custom widgets on my overview page, which are all expandable cards.
As my system grows i want to reuse some widgets in other widgets t save some code lines.

The first repeater with the toggle items is ok
The list item with the accordion repeater is also ok
The third repeater does as expected but the alignment of the embeded widget looks not so good, see sceenshot


The content of the third repeater produces a space on the left
The content of the accordion repeater is aligned perfect, second sceenshot

Here is my widget code.

uid: beleuchtung_garten_neu_V3
tags: []
props:
  parameterGroups: []
timestamp: Nov 22, 2022, 9:32:21 PM
component: f7-card
config:
  backdrop: true
  class:
    - card-expandable-animate-width
  expandable: true
  style:
    --f7-card-expandable-box-shadow: 0px 5px 4px rgba(0, 0, 0, 0.5)
    --f7-card-expandable-margin-horizontal: 5px
    --f7-card-expandable-margin-vertical: 7px
    --f7-card-expandable-tablet-border-radius: 0px
    --moz-user-select: none
    --ms-user-select: none
    --webkit-user-select: none
    background: "#32CD32"
    height: 54px
    width: auto
  swipeToClose: true
slots:
  default:
    - component: f7-card-content
      config:
        style:
          width: 100%
      slots:
        default:
          - component: oh-button
            config:
              class:
                - card-opened-fade-in
                - cell-close-button
                - card-close
              color: black
              iconF7: xmark_circle
              iconSize: 30px
              style:
                padding-bottom: 35px
                padding-top: 14px
                position: absolute
                right: 0
                top: 0
                z-index: 999
          - component: f7-block
            config:
              class:
                - no-padding
              style:
                height: 200px
                margin: 0px
            slots:
              default:
                - component: f7-row
                  slots:
                    default:
                      - component: f7-col
                        config:
                          class:
                            - display-flex
                          medium: "10"
                          small: "10"
                          width: "10"
                        slots:
                          default:
                            - component: f7-icon
                              config:
                                material: outdoor_grill
                                size: 25px
                      - component: f7-col
                        config:
                          class:
                            - display-flex
                            - justify-content-space-between
                          medium: "50"
                          small: "50"
                          width: "50"
                        slots:
                          default:
                            - component: Label
                              config:
                                text: Garten
                            - component: Label
                              config:
                                text: =items.Hueoutdoortemperaturesensor1_Temperatur.state
                      - component: f7-col
                        config:
                          class:
                            - display-flex
                            - justify-content-flex-start
                          medium: "40"
                          small: "40"
                          width: "40"
                        slots:
                          default:
                            - component: f7-icon
                              config:
                                color: yellow
                                f7: lightbulb
                                size: 25px
                                visible: "=items.Lights.state === 'ON' ? true : false | items.SwitchAll.state > 0 ?  true : false"
          - component: f7-list
            config:
              accordionList: true
            slots:
              default:
                - component: oh-repeater
                  config:
                    for: item
                    fragment: true
                    groupItem: Lights
                    sourceType: itemsInGroup
                  slots:
                    default:
                      - component: oh-toggle-item
                        config:
                          color: '=(items[loop.item.name].state == "ON") ? "yellow" : "gray"'
                          icon: ='oh:' + loop.item.category
                          iconUseState: true
                          item: =loop.item.name
                          title: =loop.item.label
                - component: oh-list-item
                  config:
                    accordionList: true
                    after: =items.SwitchAll.displayState
                    color: '=(items.SwitchAll.state > 0) ? "yellow" : "gray"'
                    icon: iconify:mdi:led-strip-variant
                    iconColor: '=(items.SwitchAll.state > 0) ? "yellow" : "gray"'
                    title: Alle Led
                  slots:
                    accordion:
                      - component: oh-repeater
                        config:
                          for: item
                          fragment: true
                          groupItem: SwitchAll
                          sourceType: itemsInGroup
                        slots:
                          default:
                            - component: f7-list
                              slots:
                                default:
                                  - component: widget:Universal_Dimmer_Card
                                    config:
                                      dimmerItem: =loop.item.name
                                      name: =loop.item.label
                                      icon: iconify:mdi:led-strip-variant
                - component: f7-list
                  slots:
                    default:
                      - component: oh-repeater
                        config:
                          for: item
                          fragment: true
                          itemTags: SwitchAll
                          sourceType: itemsWithTags
                        slots:
                          default:
                            - component: f7-list
                              slots:
                                default:
                                  - component: widget:Universal_Dimmer_Card
                                    config:
                                      dimmerItem: =loop.item.name
                                      name: =loop.item.label
                                      icon: iconify:mdi:led-strip-variant

And the widget:Universal_Dimmer_Card

uid: Universal_Dimmer_Card
tags: []
props:
  parameters:
    - context: Text
      description: Title of the card
      label: Title
      name: name
      required: false
      type: TEXT
    - context: item
      description: Dimmer Item
      label: Dimmer Item
      name: dimmerItem
      required: true
      type: TEXT
    - context: Text
      label: OpenHAB-Icon
      name: icon
      required: true
      type: TEXT
timestamp: Nov 21, 2022, 9:10:34 PM
component: f7-card
config:
  noShadow: false
  padding: false
  style:
    background: transparent
    border-radius: var(--f7-card-expandable-border-radius)
    box-shadow: 5px 5px 15px 1px rgba(0,0,0,0.3)
    height: auto
    margin-left: 5px
    margin-right: 5px
    padding: 0px
slots:
  default:
    - component: f7-card-header
      config: {}
      slots:
        default:
          - component: oh-icon
            config:
              height: 55px
              icon: =props.icon
              style:
                color: rgb(106, 106, 106)
                margin-bottom: 3%
                margin-top: 3%
          - component: f7-block
            config:
              style:
                left: 80px
                margin-bottom: 3%
                margin-top: 3%
                position: absolute
            slots:
              default:
                - component: Label
                  config:
                    style:
                      color: black
                      font-size: 15px
                      font-weight: 500
                    text: =props.name
                - component: f7-chip
                  config:
                    style:
                      background: orange
                      color: white
                      font-size: 15px
                      font-weight: 500
                      margin-top: 5px
                      width: auto
                    text: '=items[props.dimmerItem].state == 100 ? "ON" : items[props.dimmerItem].state == 0 ? "OFF" : items[props.dimmerItem].displayState + " ON"'
          - component: f7-block
            config:
              style:
                display: flex
                padding: 0
                width: auto
            slots:
              default:
                - component: oh-link
                  config:
                    action: command
                    actionCommand: OFF
                    actionItem: =props.dimmerItem
                    iconColor: gray
                    iconF7: stop_circle
                    iconSize: 30
                    style:
                      background: transparent
                      z-index: 98
    - component: f7-card-footer
      config:
        style:
          background: transparent
          border-radius: 0 0 10px 10px
          height: auto
      slots:
        default:
          - component: oh-icon
            config:
              height: 0px
              icon: props.icon
              style:
                color: rgb(106, 106, 106)
                margin-top: -4px
          - component: f7-block
            config:
              style:
                display: flex
                height: auto
                justify-content: space-between
                left: 10%
                padding: 0
                position: absolute
                width: 80%
            slots:
              default:
                - component: oh-button
                  config:
                    color: gray
                    outline: true
                    round: true
                    small: true
                    action: command
                    actionCommand: "20"
                    actionItem: =props.dimmerItem
                    textColor: '=items[props.dimmerItem].state >= 2 && items[props.dimmerItem].state <= 25 ? "yellow" : "gray"'
                    style:
                      height: 24px
                      z-index: 98
                    text: 20
                - component: oh-button
                  config:
                    color: gray
                    outline: true
                    round: true
                    small: true
                    action: command
                    actionCommand: "30"
                    actionItem: =props.dimmerItem
                    textColor: '=items[props.dimmerItem].state >= 26 && items[props.dimmerItem].state <= 35 ? "yellow" : "gray"'
                    style:
                      height: 24px
                      z-index: 98
                    text: 30
                - component: oh-button
                  config:
                    color: gray
                    outline: true
                    round: true
                    small: true
                    action: command
                    actionCommand: "50"
                    actionItem: =props.dimmerItem
                    textColor: '=items[props.dimmerItem].state >= 36 && items[props.dimmerItem].state <= 55 ? "yellow" : "gray"'
                    style:
                      height: 24px
                      z-index: 98
                    text: 50
                - component: oh-button
                  config:
                    color: gray
                    outline: true
                    round: true
                    small: true
                    action: command
                    actionCommand: "60"
                    actionItem: =props.dimmerItem
                    textColor: '=items[props.dimmerItem].state >= 56 && items[props.dimmerItem].state <= 65 ? "yellow" : "gray"'
                    style:
                      height: 24px
                      z-index: 98
                    text: 60
                - component: oh-button
                  config:
                    color: gray
                    outline: true
                    round: true
                    small: true
                    action: command
                    actionCommand: "80"
                    actionItem: =props.dimmerItem
                    textColor: '=items[props.dimmerItem].state >= 66 && items[props.dimmerItem].state <= 99 ? "yellow" : "gray"'
                    style:
                      height: 24px
                      z-index: 98
                    text: 80
                - component: oh-button
                  config:
                    color: gray
                    outline: true
                    round: true
                    small: true
                    action: command
                    actionCommand: "100"
                    actionItem: =props.dimmerItem
                    textColor: '=items[props.dimmerItem].state > 99 ? "yellow" : "gray"'
                    style:
                      height: 24px
                      z-index: 98
                    text: 100

I’m running out of ideas, any help appreciated, thanks

If I understand your question it appears that you want this column of cards to be the accordion content of the last list item, and that’s just fine. Just move the repeater with the card widgets outside of the extraneous list and put them in an f7-row with a flex-direction: column style setting and make that f7-row the first child of the accordion slot. You can consider the accordion slot a new black canvas to work on. You are not restricted to putting lists and list items in that slot. You can build a whole new page if you want to. Here’s an example where I have an entire complex speaker widget inside the accordion slot of a list:

And the code for that looks like:

          - component: oh-repeater
            config:
              accordionList: true
              filter: "(vars.showAll) ? true : items[loop.activeItem.name + '_Playing'].state=='ON'"
              for: activeItem
              itemTags:
                - Speaker
              sourceType: itemsWithTags
            slots:
              default:
                - component: oh-list-item
                  config:
                    icon: ='oh:' + loop.activeItem.category
                    title: =loop.activeItem.label
                  slots:
                    accordion:
                      - component: f7-col
                        config:
                          style:
                            align-items: center
                            display: flex
                            flex-direction: column
                        slots:
                          default:
                            - component: oh-image
                              config:
                                item: =loop.activeItem.name + '_CurrentAlbumCoverArt'
                                style:
                                  padding: 10px
                                  width: 50%
                            - component: Label
                              config:
                                style:
                                  font-size: large
                                  font-weight: bold
                                text: =items[loop.activeItem.name + '_MediaTitle'].state
                            - component: Label
                              config:
                                style:
                                  overflow: hidden
                                  padding-bottom: 5px
                                  text-overflow: ellipsis
                                  white-space: nowrap
                                text: =items[loop.activeItem.name + '_MediaArtist'].state + " - " + items[loop.activeItem.name + '_CurrentAlbum'].state
                            - component: oh-player-controls
                              config:
                                item: =loop.activeItem.name + '_MediaControl'
                            - component: f7-row
                              config:
                                style:
                                  padding: 5px
                                  width: 90%
                              slots:
                                default:
                                  - component: oh-link
                                    config:
                                      action: toggle
                                      actionCommand: ON
                                      actionCommandAlt: OFF
                                      actionItem: =loop.activeItem.name + '_Mute
                                      iconF7: "=(items[loop.activeItem.name + '_Mute'].state=='ON') ? 'speaker_slash' : 'speaker_2'"
                                      style:
                                        flex: 1
                                  - component: oh-slider
                                    config:
                                      item: =loop.activeItem.name + '_Volume'
                                      style:
                                        flex: 9
                            - component: oh-link
                              config:
                                action: url
                                actionUrl: sonos://
                                iconF7: arrowshape_turn_up_right
                                visible: =device.android
1 Like

It is not exactly what i wanted, but with your code snippet you pushed me in the right direction.

          - component: f7-list
            config:
              accordionList: true
            slots:
              default:
                - component: oh-repeater
                  config:
                    for: item
                    fragment: true
                    groupItem: Lights
                    sourceType: itemsInGroup
                  slots:
                    default:
                      - component: oh-toggle-item
                        config:
                          color: '=(items[loop.item.name].state == "ON") ? "yellow" : "gray"'
                          icon: ='oh:' + loop.item.category
                          iconUseState: true
                          item: =loop.item.name
                          title: =loop.item.label
                - component: oh-list-item
                  config:
                    accordionList: true
                    after: =items.SwitchAll.displayState
                    color: '=(items.SwitchAll.state > 0) ? "yellow" : "gray"'
                    icon: iconify:mdi:led-strip-variant
                    iconColor: '=(items.SwitchAll.state > 0) ? "yellow" : "gray"'
                    title: Alle Led
                  slots:
                    accordion:
                      - component: oh-repeater
                        config:
                          for: item
                          fragment: true
                          groupItem: SwitchAll
                          sourceType: itemsInGroup
                        slots:
                          default:
                            - component: f7-col
                              config:
                                style:
                                align-items: center
                                display: flex
                                flex-direction: column
                              slots:
                                default:
                                  - component: widget:Universal_Dimmer_Card
                                    config:
                                      dimmerItem: =loop.item.name
                                      name: =loop.item.label
                                      icon: iconify:mdi:led-strip-variant

                - component: oh-repeater
                  config:
                          for: item
                          fragment: true
                          itemTags: SwitchAll
                          sourceType: itemsWithTags
                  slots:
                          default:
                            - component: f7-col
                              config:
                                style:
                                align-items: center
                                display: flex
                                flex-direction: column
                              slots:
                                default:
                                  - component: widget:Universal_Dimmer_Card
                                    config:
                                      dimmerItem: =loop.item.name
                                      name: =loop.item.label
                                      icon: iconify:mdi:led-strip-variant

Thank you Justin, you made my day.