radio-deck icon indicating copy to clipboard operation
radio-deck copied to clipboard

[Feature Request]: different color for each option

Open chengkangzai opened this issue 1 year ago • 1 comments

What happened?

Feature Request: Color customization for RadioDeck options

First of all, thank you for creating such an amazing package! I've been using it in my projects and it's been incredibly helpful.

Current Behavior

Currently, RadioDeck allows us to create beautiful radio button groups with options like this:

RadioDeck::make('What do you feel')
    ->columns(5)
    ->options([
        '5' => 'Very Satisfied',
        '4' => 'Satisfied',
        '3' => 'Neutral',
        '2' => 'Dissatisfied',
        '1' => 'Very Dissatisfied',
    ]),

Feature Suggestion

I was wondering if it might be possible to add color customization for individual options? Something like this:

phpCopyRadioDeck::make('What do you feel')
    ->columns(5)
    ->color([
        '5' => 'green',
        '4' => 'emerald',
        '3' => 'gray',
        '2' => 'yellow',
        '1' => 'red',
    ]),

This would be particularly useful for satisfaction surveys or rating systems where color coding could enhance the user experience.

Use Cases

  • Satisfaction surveys
  • Rating systems
  • Status indicators
  • Risk assessments

I completely understand if this doesn't align with the package's roadmap or if there are technical limitations. Please let me know if you need any clarification or if there's already a better way to achieve this. Thanks for considering this suggestion! 🙏

How to reproduce the bug

Its a feature request

btw... i wish to use the feature under discussion but it doesnt seems like working

Package Version

1.2.9

PHP Version

8.2.0

Laravel Version

10.0.0

Which operating systems does with happen with?

No response

Notes

No response

chengkangzai avatar Dec 16 '24 10:12 chengkangzai

This is exactly what I am looking to do as well.

keytactic avatar Feb 12 '25 16:02 keytactic

I also needed this :)

I did a fork of the project to add this feature ;)

https://github.com/geof-dev/filament-radio-deck

geof-dev avatar Jun 01 '25 07:06 geof-dev

I also needed this :)

I did a fork of the project to add this feature ;)

https://github.com/geof-dev/filament-radio-deck

Maybe you wanna open a PR so that @199ocero can merge it in ?

chengkangzai avatar Jun 04 '25 03:06 chengkangzai

Added support for this feature in latest release

199ocero avatar Sep 14 '25 12:09 199ocero