Skip to content

[poc] Label component - #4126

Closed
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/standalone-label-demos
Closed

atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/standalone-label-demos

Conversation

@atomiks

@atomiks atomiks commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4122

Preview: https://deploy-preview-4126--base-ui.netlify.app/react/components/label


Not all SRs support an enclosing native <label> around a non-form (<span>) control. Therefore the demos either need to use aria-labelledby or a custom render function to render a label-wrapped <button> with nativeButton.

This component provides aria-labelledby automatically (same as Field.Label) to ensure the accessible name works broadly while supporting enclosing labels without invalid HTML. This also separates Field validation from labeling when controls need a basic label (especially Select/Combobox demos) where the native <label> has some undesirable defaults. We can neatly use this in all form control demos that need a lightweight label instead of using Field.


This also adds a new useAriaLabelledby hook as a fallback for the sibling pattern without nativeButton, since it was common in Radix:

<label htmlFor="id" />
<Checkbox.Root id="id" />

@atomiks atomiks added the poc label Feb 18, 2026
@pkg-pr-new

pkg-pr-new Bot commented Feb 18, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/@base-ui/react@4126
    
    pnpm add https://pkg.pr.new/@base-ui/utils@4126
    

commit: 85d0390

@mui-bot

mui-bot commented Feb 18, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+1.32KB(+0.29%) 🔺+410B(+0.28%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 85d0390
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69970e9224720000080e1dbb
😎 Deploy Preview https://deploy-preview-4126--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks
atomiks force-pushed the codex/standalone-label-demos branch 19 times, most recently from 8cad473 to 0b3e981 Compare February 19, 2026 13:09
@atomiks
atomiks force-pushed the codex/standalone-label-demos branch from 0b3e981 to 85d0390 Compare February 19, 2026 13:22
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 24, 2026
@atomiks atomiks closed this May 4, 2026
@atomiks
atomiks deleted the codex/standalone-label-demos branch May 4, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

poc PR: out-of-date The pull request has merge conflicts and can't be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Radio.Root, Checkbox.Root, and Switch.Root do not receive an accessible name from a wrapping <label> element

2 participants