x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!-- Checkbox -->
<label class="card-selectable flex items-start">
<input type="checkbox" name="enable_notifications" id="enable_notifications" value="1" class="checkbox" checked="checked" />
<div class="flex flex-col mis-3">
<h5 class="text-sm leading-none font-medium mbe-1">Enable notifications</h5>
<p class="text-sm text-subtle">You can enable or disable notifications at any time.</p>
</div>
</label>
<!-- Radio -->
<div class="flex flex-col gap">
<label class="card-selectable flex items-start">
<input type="radio" name="plan" id="plan_starter_plan" value="starter_plan" class="checkbox" checked="checked" />
<div class="flex flex-col mis-3">
<h5 class="text-sm leading-none font-medium mbe-1">Starter Plan</h5>
<p class="text-sm text-subtle">Perfect for small businesses getting started with our platform.</p>
</div>
</label>
<label class="card-selectable flex items-start">
<input type="radio" name="plan" id="plan_pro_plan" value="pro_plan" class="checkbox" />
<div class="flex flex-col mis-3">
<h5 class="text-sm leading-none font-medium mbe-1">Pro Plan</h5>
<p class="text-sm text-subtle">Advanced features for growing businesses with higher demands.</p>
</div>
</label>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<%# Checkbox %>
<label class="card-selectable flex items-start">
<%= check_box_tag :enable_notifications, 1, true, class: "checkbox" %>
<div class="flex flex-col mis-3">
<h5 class="text-sm leading-none font-medium mbe-1">Enable notifications</h5>
<p class="text-sm text-subtle">You can enable or disable notifications at any time.</p>
</div>
</label>
<%# Radio %>
<div class="flex flex-col gap">
<label class="card-selectable flex items-start">
<%= radio_button_tag :plan, :starter_plan, 1, class: "checkbox" %>
<div class="flex flex-col mis-3">
<h5 class="text-sm leading-none font-medium mbe-1">Starter Plan</h5>
<p class="text-sm text-subtle">Perfect for small businesses getting started with our platform.</p>
</div>
</label>
<label class="card-selectable flex items-start">
<%= radio_button_tag :plan, :pro_plan, class: "checkbox" %>
<div class="flex flex-col mis-3">
<h5 class="text-sm leading-none font-medium mbe-1">Pro Plan</h5>
<p class="text-sm text-subtle">Advanced features for growing businesses with higher demands.</p>
</div>
</label>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.card {
background-color: var(--color-bg);
border-radius: var(--rounded-xl);
border-width: var(--border);
padding: var(--size-6);
box-shadow: var(--shadow-sm);
}
.card-selectable {
background-color: var(--color-bg);
border-radius: var(--rounded-xl);
border-width: var(--border);
padding: var(--size-3);
&:has(:checked) {
background-color: var(--color-secondary);
border-color: var(--color-primary);
}
}
Java Script is not required or multiple files are needed, check the notes.