Skip to content

feat(Select/SelectMenu): Add group-label and separator slots to Select and SelectMenu #4248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: v3
Choose a base branch
from

Conversation

OpenSnack
Copy link

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Adds the following optional slots to the Select and SelectMenu components:

  • group-label: Replaces the default content when an item with the label type is rendered.
  • separator: Replaces the default content when an item with the separator type is rendered.

This allows you to further customize the content before/between item groups, which is possible in Reka UI but not currently possible in Nuxt UI. Both slots provide the current item and index, as with the other slots that already exist. The group-label slot also provides groupIndex.

<USelect :items="items">
  <template #group-label="{ item, index, groupIndex }">
    <!-- content -->
  </template>
  <template #separator="{ item, index }">
    <!-- content -->
  </template>
</USelect>

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

(As I understand it, the relevant documentation for this change is updated automatically.)

Copy link

pkg-pr-new bot commented May 28, 2025

npm i https://pkg.pr.new/@nuxt/ui@4248

commit: b4a3633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant