Skip to content

[KDropdownMenu] Enable options customization #1200

@MisRob

Description

@MisRob

Overview

Complexity: Low

Context

In several Studio use-cases, we need to customize content of KDropdownMenu items beyond what is possible via options array configuration. Typically icon placement, color, text size, ... Examples:

UiMenu actually allows for this via this scoped option slot

<slot name="option" :option="option"></slot>

, we just yet didn't made the slot available in KDropdownMenu for public use.

The Change

Expose UiMenu's option slot in KDropdownMenu for public use like:

<KDropdownMenu :options="options" ... >
  <template #option="{ option }">
     <KIcon ... /> {{ option.label }}
  </template>
</KDropdownMenu>
  • Update documentation with an example demonstrating the slot use
  • Add a visual test

Guidance

Acceptance criteria

  • The specification above is followed
  • There are no regressions
  • There is a visual test
  • The documentation is updated
    • Follows writing guidelines
    • Is concise and consistent with other documentation pages

References

Supports learningequality/studio#5060

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions