Icon not spinning

Hi have been trying to get icons to spin unfortunately Im having no luck

type: ‘custom:button-card’
show_entity_picture: true
'state:

  • value: ‘on’
    styles:
    icon:
    spin: true
    tap_action:
    action: toggle
    entity: switch.sonoff_1000feaf04_1
    icon: ‘mdi:fan’

Hi Deshan,

put spin: true directly under state:


state:
  - value: 'on'
    spin: true

P.S.: It‘s easier for others when you use the code function in the editor, looks like </>

Thank you it works now