miladfm / ngx-pretty-checkbox

Quickly integrate pretty checkbox components with Angular
https://miladfm.github.io/ngx-pretty-checkbox/
MIT License
26 stars 5 forks source link

More examples on the demo page #1

Closed victorcarvalhosp closed 5 years ago

victorcarvalhosp commented 5 years ago

Hello guys! I really liked this components, but I can't find anywhere how to make a two icons component like this: image Can you guys please update the demo page with these examples?

Thanks!

miladfm commented 5 years ago

Hi, tnx for use my project.

For border set 'plain' to true, and use 'p-toggle' component inside of 'p-checkbox'.

here is example, that you want.

<p-checkbox plain="true">

    <p-toggle type="on">
        <i p-icon class="material-icons">wifi</i>
        Wifi on
    </p-toggle>

    <p-toggle type="off">
        <i p-icon class="material-icons">wifi_off</i>
        Wifi off
    </p-toggle>

</p-checkbox>

Link to live example : https://stackblitz.com/edit/ngx-pretty-checkbox-wifi-example

victorcarvalhosp commented 5 years ago

Thanks! And how I can make this with radio buttons?

If you can add these instructions on the documentation would be awesome!

miladfm commented 5 years ago

just change p-checkbox to p-radio. then wrap all p-radio components with 'p-radio-group' component

<p-radio-group>

  <p-radio plain="true">

      <p-toggle type="on">
          <i p-icon class="material-icons">wifi</i>
          Wifi on 1
      </p-toggle>

      <p-toggle type="off">
          <i p-icon class="material-icons">wifi_off</i>
          Wifi off 1
      </p-toggle>

  </p-radio>

  <p-radio plain="true">

      <p-toggle type="on">
          <i p-icon class="material-icons">wifi</i>
          Wifi on 2
      </p-toggle>

      <p-toggle type="off">
          <i p-icon class="material-icons">wifi_off</i>
          Wifi off 2
      </p-toggle>

  </p-radio>

</p-radio-group>

I will make more examples and update demo page.