Skip to content

feat(ui): add input group - #9654

Draft
austincalvelage wants to merge 1 commit into
austin/headless-inputfrom
austin/input-group
Draft

feat(ui): add input group#9654
austincalvelage wants to merge 1 commit into
austin/headless-inputfrom
austin/input-group

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Sep 4, 2026

Copy link
Copy Markdown
Member

Description

https://swingset-git-austin-input-group.clerkstage.dev/components/input-group

CleanShot 2026-09-03 at 19 30 10@2x

Adds Mosaic InputGroup for composing text and controls inside shared field chrome. It coordinates sizing, field state, and focus behavior with a headless Input.

@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 46e7b53

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Sep 4, 2026 5:03am UTC
swingset Ready Ready Preview Sep 4, 2026 5:03am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

@maxyinger maxyinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we don't do concentic border radii on this project a lot, but wondering if we use this size button anywhere else and if it makes sense to just make its radius concentric with the input

ref,
forwardedRef,
) {
const inputGroup = useOptionalInputGroupContext();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just use presence of this to determine if it should be the headless variant?

Comment on lines +32 to +34
const setInput = React.useCallback((node: HTMLInputElement | null) => {
inputRef.current = node;
}, []);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idc too much about semantics, but since this is just a standard callback ref, would be cool with it just being like inputRef or something. the set makes me feel like it's holding it in state somewhere

Comment on lines +52 to +62
const setInputRef = React.useCallback(
(node: HTMLInputElement | null) => {
setGroupInput?.(node);
if (typeof forwardedRef === 'function') {
forwardedRef(node);
} else if (forwardedRef) {
forwardedRef.current = node;
}
},
[forwardedRef, setGroupInput],
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a combine refs util? feels like it'd be worth adding one if we don't already so we can just do:

ref: combineRefs(forwardedRef, inputGroup?.inputRef),

Comment on lines +76 to +82
onPointerDown: (event: React.PointerEvent<HTMLSpanElement>) => {
onPointerDown?.(event);
if (!event.defaultPrevented) {
event.preventDefault();
group.focusInput();
}
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt about just making this pointer-events: none and adding an onclick to the group that focuses the input?

},
text: {
alignItems: 'center',
color: colorVars['--cl-color-neutral-faded'],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost like the color of this more in the disabled state 🤔 . This almost feels too emphasized, or at least a little off with the placeholders in dark mode.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we just match the color of the placeholder for this?

);
});

export const InputGroup = { Root, Text, Action };

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt about adding like an addon container to this like shadcn?

https://ui.shadcn.com/docs/components/base/input-group#button

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants