Home > Mobile >  How can I change the background color of ion-item when ion-toggle is enabled
How can I change the background color of ion-item when ion-toggle is enabled

Time:09-15

How can I change the background color of ion-item when ion-toggle is enabled Also showing Available when activating and showing Unavailable when closing

<ion-item>
      <ion-label>
        Status
        <span>Available</span>
        <span>Unavailable</span>
      </ion-label>
      <ion-toggle></ion-toggle>
    </ion-item>

CodePudding user response:

By using the custom property provided in the docs. https://ionicframework.com/docs/api/item#css-custom-properties

CodePudding user response:

Check the below Stack blitz and let me know if you need any modifications

https://stackblitz.com/edit/ionic-toggle-eg-6apotx?file=pages/home/home.html,pages/home/home.ts
  • Related