Skip to content

zk-checkbox ​

Renders an <input type="checkbox">. When field is true, delegates to zk-input for full field wrapper support.

Props ​

PropTypeDefaultDescription
namestring|nullnullname attribute
idstring|nullnullid — falls back to name
fieldbooltrueWrap in field structure via zk-input
labelBeforeboolfalseOverrides zk-input's own true default — "☐ Label" reads better than the reverse

All other zk-input props are accepted when field is true (delegated). When field is false, all undeclared attributes forward directly to the <input>.

Examples ​

Basic ​

blade
<x-zk-checkbox name="agree" label="I agree to the terms" />

Pre-checked ​

blade
<x-zk-checkbox name="newsletter" label="Subscribe to newsletter" :checked="$user->newsletter" />

Bare checkbox (no field wrapper) ​

blade
<x-zk-checkbox name="active" :field="false" value="1" checked />

With Alpine.js ​

blade
<x-zk-checkbox name="accept" :field="false" x-model="accepted" />

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.