Small Star Checkbox
0 viewseasy
Background:
1
2
3
4
5
6
7
8
<label class="small-star-container">
<input type="checkbox" />
<div class="small-star-checkmark">
<svg viewBox="0 0 24 24">
<polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"/>
</svg>
</div>
</label>Small Star Checkbox
0 viewseasy
Background:
Small Star Checkbox
1
2
3
4
5
6
7
8
<label class="small-star-container">
<input type="checkbox" />
<div class="small-star-checkmark">
<svg viewBox="0 0 24 24">
<polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"/>
</svg>
</div>
</label>Was this helpful?
What is inside Small Star Checkbox
Small Star Checkbox is a CSS checkbox built with transforms, defined in 35 lines across 5 selectors.
15
CSS properties
5
Selectors
35
Lines of CSS
3
Formats
Techniques used
TransitionsTransformsChecked stateFlexbox
CSS properties in this component
align-itemscursordisplayfillheightinputjustify-contentopacitypositionstrokestroke-widthtransformtransitionuser-selectwidthAccessibility check1 to fix
- Built on a native <label> element, so keyboard focus and screen reader semantics work without extra attributes.
- No focus style is defined. Add one before shipping, or keyboard users lose track of position.
These notes are generated by reading this component's own source, so they describe what it actually does rather than what a template says. Copy the code above in HTML, CSS, Tailwind and adapt it freely.