File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 22 ' label' , // group label OR single checkbox label
33 ' name' => $attributes -> whereStartsWith (' wire:model' )-> first (),
44 ' options' => null , // if array → group mode; if null → single mode
5+ ' value' => null ,
6+ ' text' => null ,
57 ' badge' => null ,
68] )
79
810@php
911$badge ??= $attributes -> whereStartsWith (' required' )-> isNotEmpty () ? ' Required' : null ;
12+ $text ??= $value ;
1013@endphp
1114
1215{{-- Group Mode (options array is passed) --}}
2225
2326{{-- Single Checkbox Mode --}}
2427@else
25- <flux:field variant =" inline" >
26- <flux:checkbox :$attributes />
27-
28- <flux:label :$badge >{{ $label } } </flux:label >
29-
30- <flux:error :$name />
31- </flux:field >
28+ <flux:checkbox .group :$label :$badge :$attributes >
29+ <flux:checkbox
30+ :value =" $value"
31+ :label =" $text"
32+ />
33+ </flux:checkbox .group >
3234@endif
Original file line number Diff line number Diff line change 1313 </div >
1414 </div >
1515 </div >
16- <div class =" region padded-small tint" >
16+ <div class =" region padded tint" >
1717 <div class =" container container-full" >
1818 <div class =" section" >
1919 <h2 >Basic Text</h2 >
@@ -101,7 +101,9 @@ class="native-size"
101101 <form >
102102 <x-cds .checkbox
103103 name =" terms"
104- label =" I agree to the terms and conditions"
104+ label =" Terms and Conditions"
105+ description =" Please review our terms and conditions before proceeding."
106+ value =" I agree to the terms and conditions"
105107 required
106108 error:message =" This field has an error."
107109
@@ -139,6 +141,8 @@ class="native-size"
139141 error:message =" This field has an error."
140142
141143 />
144+ <flux:separator class =" mb-4" />
145+
142146 <x-cds .button type =" submit" >Submit</x-cds .button >
143147 <x-cds .button type =" reset" >Reset</x-cds .button >
144148 </form >
You can’t perform that action at this time.
0 commit comments