Open ziming opened 2 years ago
I like the idea, but we can't have a "field description" (we already have something similar, hint
), it needs to be "option description".
I think it's a very interesting and usefull thing to have, but sure we need either: checkboxes_with_description
, radio_with_description
fields to don't mess previous fields API, or somehow introduce the ability to add those descriptions.
Current:
[
'name' => 'status',
'label' => 'Status',
'type' => 'radio',
'options' => [
0 => 'Draft',
1 => 'Published'
]
],
Maybe:
[
'name' => 'status',
'label' => 'Status',
'type' => 'radio',
'options' => [
['key' => 0, 'label' => 'Draft', 'description' => 'Some description']
['key' => 1, 'label' => 'Published', 'description' => 'Some description']
]
],
I will be moving this to the Ideas so that we can continue the discussion about it.
Cheers
I agree, I've needed this too at some point and rolled my own field type. I don't think this should be added to the current field types though, we should probably create new ones. Which we will anyway once we create new fields for our Livewire components, because we'll be using Tabler and it has a UI for this already: https://preview.tabler.io/form-elements.html
So let's postpone this until then.
Cheers!
Feature Request
What's the feature you think Backpack should have?
Seeing is better than explaining. Basically allow specifying description that will be placed below each radio/checkbox label
https://tailwindui.com/components/application-ui/forms/radio-groups
https://tailwindui.com/components/application-ui/forms/checkboxes
Have you already implemented a prototype solution, for your own project?
No. At it's easiest I guess you can do something like this
Or it can go more advanced
Do you see this as a core feature or an add-on?
Core