Skip to content

fix(CheckboxGroup): add label and description to theme slots#6453

Open
OfirHaf wants to merge 1 commit into
nuxt:v4from
OfirHaf:fix/checkbox-group-label-description-slots
Open

fix(CheckboxGroup): add label and description to theme slots#6453
OfirHaf wants to merge 1 commit into
nuxt:v4from
OfirHaf:fix/checkbox-group-label-description-slots

Conversation

@OfirHaf
Copy link
Copy Markdown

@OfirHaf OfirHaf commented May 17, 2026

Fixes #6337

Problem

CheckboxGroupSlots defines label and description slots (they are forwarded to each inner Checkbox), but src/theme/checkbox-group.ts only declares root, fieldset, legend, and item.

This means customising via app.config.ts throws a type error:

export default defineAppConfig({
  ui: {
    checkboxGroup: {
      slots: {
        label: 'font-normal' // ❌ Type error: Object literal may only specify known properties
      }
    }
  }
})

...even though it works correctly at runtime.

Fix

Add label and description to the slots map with the same default classes already used in checkbox.ts and radio-group.ts:

label: 'block font-medium text-default',
description: 'text-muted'

Why it's safe

  • Purely additive — no existing slot is changed
  • Default classes are identical to sibling components (Checkbox, RadioGroup)
  • No runtime behavior changes; this only makes the existing behavior typeable

CheckboxGroupSlots defines label and description slots (forwarded to
each inner Checkbox), but the theme only declared root, fieldset,
legend, and item — making label/description invisible to app.config.ts
type checking even though they work correctly at runtime.

Added label and description with the same default classes used in
checkbox.ts and radio-group.ts (the sibling components).

Fixes nuxt#6337
@OfirHaf OfirHaf requested a review from benjamincanac as a code owner May 17, 2026 09:00
@github-actions github-actions Bot added the v4 #4488 label May 17, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48dc2a52-370e-4191-9c95-39450aa4844b

📥 Commits

Reviewing files that changed from the base of the PR and between f317c7f and 6301672.

📒 Files selected for processing (1)
  • src/theme/checkbox-group.ts

📝 Walkthrough

Walkthrough

This PR updates the CheckboxGroup theme configuration by expanding the slots object in src/theme/checkbox-group.ts. The label slot is now defined with block font-medium text-default styling, and a new description slot is added with text-muted styling. The item slot remains as an empty string. These additions complete the theme type definitions for the CheckboxGroup component's available slots.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding label and description to the CheckboxGroup theme slots, which is exactly what the PR accomplishes.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the problem, the fix, and why it's safe. It references issue #6337 and provides clear context.
Linked Issues check ✅ Passed The PR directly addresses issue #6337 by adding the missing label and description slots to the CheckboxGroup theme configuration, resolving the type mismatch and allowing proper configuration in app.config.ts.
Out of Scope Changes check ✅ Passed The changes are strictly within scope, modifying only the slots map in checkbox-group.ts to add label and description entries, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/theme/checkbox-group.ts

Parsing error: Unexpected token {


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 17, 2026

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

commit: 6301672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CheckboxGroup label slot type missing in app.config.ts

1 participant