Search code examples
angularprimeng

not getting circular input switch primeng component


  • i am following the primeng documentation for InputSwitch component in which that component is circular but i am getting square kind of component
  • attaching the image

Code:

<p-inputSwitch [(ngModel)]="isOn" (onChange)="handleChange()" ></p-inputSwitch>
  • i am not able to find any border or rounded properties
  • we need to design the label staticaly ? there are not any label related props supporting

Solution

  • override the styles is works.

    :host {
      ::ng-deep p-inputswitch .p-inputswitch-slider {
        border-radius: 30px;
      }
      ::ng-deep p-inputswitch .p-inputswitch-slider::before {
        border-radius: 50%;
      }
    }