From 554b36786c5645dc955c81af41aa06613dc24b6a Mon Sep 17 00:00:00 2001 From: Joel Stein Date: Tue, 16 Jun 2026 07:25:31 -0500 Subject: [PATCH 1/3] Added support for left-aligned radio cards Extended the radio "cards" variant's "indicator" prop to accept a position. "start"/"left" render the indicator on the left side of the card, while "end"/"right"/true keep the existing right-aligned default and false continues to hide it. The position can be set per card or on the group (inherited via @aware). --- .../flux/radio/group/variants/cards.blade.php | 1 + .../views/flux/radio/variants/cards.blade.php | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/stubs/resources/views/flux/radio/group/variants/cards.blade.php b/stubs/resources/views/flux/radio/group/variants/cards.blade.php index c7b009cd..7d593a8e 100644 --- a/stubs/resources/views/flux/radio/group/variants/cards.blade.php +++ b/stubs/resources/views/flux/radio/group/variants/cards.blade.php @@ -11,6 +11,7 @@ 'variant' => null, 'size' => null, 'name' => null, + 'indicator' => true, ]) @php diff --git a/stubs/resources/views/flux/radio/variants/cards.blade.php b/stubs/resources/views/flux/radio/variants/cards.blade.php index c2991abf..2f327fc1 100644 --- a/stubs/resources/views/flux/radio/variants/cards.blade.php +++ b/stubs/resources/views/flux/radio/variants/cards.blade.php @@ -14,6 +14,15 @@ ]) @php +// Normalize the "indicator" prop into a position. `true` keeps the historical +// right-aligned indicator, `false` hides it, and `start`/`end` (with `left`/`right` +// aliases) control which side of the card the indicator sits on... +$indicatorPosition = match ($indicator) { + 'start', 'left' => 'start', + 'end', 'right', true => 'end', + default => false, +}; + $iconClasses = Flux::classes() ->add('inline-block mt-0.5 text-zinc-400 [ui-radio[data-checked]_&]:text-zinc-800 dark:[ui-radio[data-checked]_&]:text-white') // When using the outline icon variant, we need to size it down to match the default icon sizes... @@ -21,7 +30,8 @@ ; $classes = Flux::classes() - ->add('relative flex justify-between gap-3 flex-1 p-4') + ->add('relative flex gap-3 flex-1 p-4') + ->add($indicatorPosition === 'start' ? 'justify-start' : 'justify-between') ->add('rounded-lg shadow-xs') ->add('bg-white dark:bg-white/10 dark:hover:bg-white/15 dark:data-checked:bg-white/15') ->add('after:absolute after:-inset-px after:rounded-lg') @@ -54,6 +64,10 @@ {{-- We have to put "data-flux-field" so that a single box can be disabled without "disabling" the group field label... --}} class($classes) }} data-flux-control data-flux-radio-cards tabindex="-1" data-flux-field> + + + +
@@ -70,7 +84,7 @@
- + From 6b3a9fc2a6ec4048aa29b761792eda417b0d677c Mon Sep 17 00:00:00 2001 From: Josh Hanley Date: Fri, 3 Jul 2026 09:32:02 +1000 Subject: [PATCH 2/3] Preserve radio card indicator truthiness --- .../views/flux/radio/variants/cards.blade.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/stubs/resources/views/flux/radio/variants/cards.blade.php b/stubs/resources/views/flux/radio/variants/cards.blade.php index 2f327fc1..526d714b 100644 --- a/stubs/resources/views/flux/radio/variants/cards.blade.php +++ b/stubs/resources/views/flux/radio/variants/cards.blade.php @@ -14,14 +14,12 @@ ]) @php -// Normalize the "indicator" prop into a position. `true` keeps the historical -// right-aligned indicator, `false` hides it, and `start`/`end` (with `left`/`right` -// aliases) control which side of the card the indicator sits on... -$indicatorPosition = match ($indicator) { - 'start', 'left' => 'start', - 'end', 'right', true => 'end', - default => false, -}; +// Normalize the "indicator" prop into a position while preserving the previous truthy/falsy behaviour... +$indicatorPosition = $indicator ? 'end' : false; + +if ($indicator === 'start' || $indicator === 'left') { + $indicatorPosition = 'start'; +} $iconClasses = Flux::classes() ->add('inline-block mt-0.5 text-zinc-400 [ui-radio[data-checked]_&]:text-zinc-800 dark:[ui-radio[data-checked]_&]:text-white') From 7e91b1d8631c718734da6b54b2ecc891547cb8b8 Mon Sep 17 00:00:00 2001 From: Caleb Porzio Date: Fri, 3 Jul 2026 11:17:32 -0400 Subject: [PATCH 3/3] Fix spelling: behaviour -> behavior Co-Authored-By: Claude Fable 5 --- stubs/resources/views/flux/radio/variants/cards.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/resources/views/flux/radio/variants/cards.blade.php b/stubs/resources/views/flux/radio/variants/cards.blade.php index 526d714b..23a6e051 100644 --- a/stubs/resources/views/flux/radio/variants/cards.blade.php +++ b/stubs/resources/views/flux/radio/variants/cards.blade.php @@ -14,7 +14,7 @@ ]) @php -// Normalize the "indicator" prop into a position while preserving the previous truthy/falsy behaviour... +// Normalize the "indicator" prop into a position while preserving the previous truthy/falsy behavior... $indicatorPosition = $indicator ? 'end' : false; if ($indicator === 'start' || $indicator === 'left') {