sackey 6b878bb0a0
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Initial commit
2025-09-12 16:19:56 +00:00

27 lines
761 B
PHP

@props([
'name' => null,
'variant' => null,
])
@php
// We only want to show the name attribute it has been set manually
// but not if it has been set from the `wire:model` attribute...
$showName = isset($name);
if (! isset($name)) {
$name = $attributes->whereStartsWith('wire:model')->first();
}
$classes = Flux::classes()
// Adjust spacing between fields...
->add('*:data-flux-field:mb-3')
->add('[&>[data-flux-field]:has(>[data-flux-description])]:mb-4')
->add('[&>[data-flux-field]:last-child]:mb-0!')
;
@endphp
<flux:with-field :$attributes>
<ui-radio-group {{ $attributes->class($classes) }} @if($showName) name="{{ $name }}" @endif data-flux-radio-group>
{{ $slot }}
</ui-radio-group>
</flux:with-field>