Showing last change depends on state

Hey all,
Im trying to display on a custom button card a last time changed field only if the state is on.
Here is what i tried to do…

Thanks foe the help!

How about this:

- type: custom:button-card
  tap_action:
    action: toggle
  entity: input_boolean.test
  show_last_changed: true
  show_state: false
  state:
    - value: 'off'
      styles:
        label:
          - display: none
1 Like

wow I didnt even think to play with the display!
thanks for opening a new mind for me!