<div class="checkboxContainer">
<div class="outsideBorder">
<label class="customCheckboxWrapper">
<input type="checkbox" class="customCheckboxInput" />
<span class="customCheckbox"></span>
<span class="checkboxContent">Red</span>
</label>
</div>
<div class="outsideBorder">
<label class="customCheckboxWrapper">
<input type="checkbox" class="customCheckboxInput" checked />
<span class="customCheckbox"></span>
<span class="checkboxContent">Blue</span>
</label>
</div>
<div class="outsideBorder">
<label class="customCheckboxWrapper">
<input type="checkbox" class="customCheckboxInput" />
<span class="customCheckbox"></span>
<span class="checkboxContent">Green</span>
</label>
</div>
<div class="outsideBorder">
<label class="customCheckboxWrapper">
<input type="checkbox" class="customCheckboxInput" />
<span class="customCheckbox"></span>
<span class="checkboxContent">Red</span>
</label>
</div>
</div>
No notes defined.
{
"questionNumber": "Question 1 / 10",
"question": "Select your favorite colors",
"dropdownLabel": "Select from dropdown list",
"nextButtonText": "Next",
"nextButtonDisabledStyle": "cursor: default; opacity: 0.6;",
"nextButtonDisabled": true,
"backgroundImage": "/assets/example-content/background.svg",
"options": [
{
"label": "Red",
"checked": false
},
{
"label": "Blue",
"checked": true
},
{
"label": "Green",
"checked": false
},
{
"label": "Red",
"checked": false
}
]
}
/* stylelint-disable */
.checkboxContainer {
max-height: 430px;
flex-grow: 1;
overflow-y: auto;
padding-right: 2%;
width: 100%;
}
.checkboxContainer::-webkit-scrollbar {
width: 3px;
padding-left: 20px;
}
.checkboxContainer::-webkit-scrollbar-thumb {
background: #aebde6;
cursor: pointer;
}
.checkboxContainer::-webkit-scrollbar-track {
-webkit-border-radius: 1rem;
border-radius: 1rem;
}
.outsideBorder {
width: 100%;
height: 50px;
display: flex;
align-items: center;
gap: 10px;
border-radius: 4px;
border: 2px solid #aebde6;
padding: 0 12px;
box-sizing: border-box;
margin-bottom: 12px;
transition: background-color 0.3s ease;
}
.customCheckboxWrapper {
display: flex;
align-items: center;
gap: 12px;
cursor: pointer;
position: relative;
}
.customCheckboxInput {
display: none;
}
.customCheckbox {
width: 24px;
height: 24px;
border: 2px solid #aab0c0;
border-radius: 4px;
background-color: transparent;
position: relative;
display: flex;
justify-content: center;
align-items: center;
transition: background-color 0.3s ease, border-color 0.3s ease;
}
.customCheckboxInput:checked + .customCheckbox {
background-color: transparent;
border-color: #FFFFFF;
}
.customCheckbox:after {
content: "";
position: absolute;
display: none;
}
.customCheckboxInput:checked + .customCheckbox:after {
display: block;
top: 4px;
width: 5px;
height: 11px;
border: solid white;
border-width: 0 3px 3px 0;
transform: rotate(45deg);
}
.checkboxContent {
font-family: FS Dillon;
font-size: 20px;
font-weight: 400;
line-height: 1;
color: #ffffff;
margin: 0;
padding: 0;
}
@media (max-width: 709px) {
.checkboxContainer {
overflow-y: scroll;
scrollbar-width: none;
}
.checkboxContainer::-webkit-scrollbar {
display: none;
}
}
<div class="checkboxContainer">
{{#each options}}
<div class="outsideBorder">
<label class="customCheckboxWrapper">
<input type="checkbox" class="customCheckboxInput" {{#if checked}}checked{{/if}} />
<span class="customCheckbox"></span>
<span class="checkboxContent">{{label}}</span>
</label>
</div>
{{/each}}
</div>