Skip to content

More metadata is needed for conditional styling #24

@AruhaMaeda

Description

@AruhaMaeda

Hi, this is a great library, and thank you for your development and sharing!

I have a feature request.
I want to change the tag Item styling based on its value.
But I think more metadata is needed to achieve this. (currently "disabled" only)

In my use case,
there are "todo", "in progress", "done" labels.
and want to change its background and text color in order for users to see what is currently selected.

In this case, something like "value" is good

            classNames={{
              tagItem: ({ value, isDisabled }) => {
                if (value === 'todo') {
                  return 'flex text-sm text-yellow-500 border border-slate-300 rounded shadow-sm mx-0.5'
                }
                if (value === 'in progress') {
                  return 'flex text-sm text-red-500 border border-slate-300 rounded shadow-sm mx-0.5'
                }
                if (value === 'done') {
                  return 'flex text-sm text-green-500 border border-slate-300 rounded shadow-sm mx-0.5'
                }
              },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions