Icons
Icon in the generic sense can mean by image, svg, or font icon kit. Pretty Checkbox works with all three ๐
Icons
Using icons is easy as eating pie ๐ฅง. It can be done in three easy steps:
- Add
p-icon
to the root div - Add your icon before the
label
- Add an
icon
selector to the tag containing the icon font
<div class="pretty p-icon">
<input type="checkbox" />
<div class="state">
<i class="icon mdi mdi-check"></i>
<label>mdi-check</label>
</div>
</div>
Supported Icon Libraries
Pretty Checkbox has been tested with the following font icons libraries:
- Font Awesome
- Bootstrap Glyphicons
- Material Icon (MDI)
- Material Icon (ZMDI)
- Material Icon (Google)
- Typeicons
- Ion icons
SVG
Similar to icon, using SVG images requires the same three basic steps:
- Add
p-svg
to the root div - Add your svg before the
label
- Add a
svg
selector to the tag containing the SVG element
<div class="pretty p-svg">
<input type="checkbox" />
<div class="state">
<svg viewbox="0 0 24 24" class="svg">
<path fill="#fff" d="..." />
</svg>
<label>mdi-check</label>
</div>
</div>
Supported SVG Libraries
Images
Last, but surely not least, images are supported, too:
- Add
p-image
to the root div - Add your svg before the
label
- Add an
image
selector to the tag containing theimg
element
<div class="pretty p-image">
<input type="checkbox" />
<div class="state">
<img src="checkmark.png" alt="check" class="image" />
<label>check (via <code>img</code>)</label>
</div>
</div>