Conditional within grid?

Is it possible to use a conditional card within a grid so that a certain card slot shows 1 of 2 cards?

i.e. in a 2x2 grid could i have the bottom right show card A if a condition is true or card B if it is false?

Normally you can achieve such things if you know the layout won’t be affected but this involves adding more cards to your 2x2 grid than the required 4

Not 100% sure if this is what you’re looking for, but I’m using this 2x2 grid and when any of the sensors is not available I just see the gauges for the ones that are:

cards:
  - cards:
      - card:
          entity: sensor.igrill2_probe_1
          max: 200
          min: 0
          severity:
            green: 130
            red: 165
            yellow: 145
          theme: default
          type: gauge
        conditions:
          - entity: sensor.igrill2_probe_1
            state_not: unavailable
        type: conditional
      - card:
          entity: sensor.igrill2_battery
          max: 100
          min: 0
          name: iGrill Battery
          theme: default
          type: gauge
        conditions:
          - entity: sensor.igrill2_battery
            state_not: unknown
        type: conditional
    type: horizontal-stack
  - cards:
      - card:
          entity: sensor.igrill2_probe_2
          max: 200
          min: 0
          severity:
            green: 130
            red: 165
            yellow: 145
          theme: default
          type: gauge
        conditions:
          - entity: sensor.igrill2_probe_2
            state_not: unavailable
        type: conditional
      - card:
          entity: sensor.igrill2_ambient_temp
          max: 550
          min: 0
          name: Ambient Temp
          theme: default
          type: gauge
        conditions:
          - entity: sensor.igrill2_ambient_temp
            state_not: unavailable
        type: conditional
    type: horizontal-stack
type: vertical-stack

In my case, I almost always see sensor.igrill2_battery because MQTT maintains the value unless I do a restart.
The ‘probe’ and ‘ambient_temp’ gauges are only visible when they are actually available in the system; for my iGrill2 thermometer that means: when the thermometer base unit is connected and the probes are plugged into the base unit.

This is what the UI shows in edit mode:
image

And this is what the UI shows right now because the iGrill2 is currently not connected.
image

Here are some more screenshots:

not quite my aim but i do like what you’ve achieved there. Imagine if one of those 4 was showing either (and this is making something up) if it was night or day. Card A for night, card B for day

I think you should be able to achieve that by using two conditional cards, one with above_horizon and the other with below_horizon.

that was more of an example :). In that scenario though id specify a 2 column grid, each with a vertical stack card. then in column 2 id need 3 rows right? maybe im over complicating things