Skip to content

Add new input group + addon components#1391

Open
bjarnef wants to merge 19 commits into
umbraco:mainfrom
bjarnef:feature/input-group-addon
Open

Add new input group + addon components#1391
bjarnef wants to merge 19 commits into
umbraco:mainfrom
bjarnef:feature/input-group-addon

Conversation

@bjarnef
Copy link
Copy Markdown
Contributor

@bjarnef bjarnef commented May 24, 2026

Description

Currently uui-input allows prepend and append.
https://uui.umbraco.com/?path=/docs/uui-input--docs#prepend-and-append-1

However the styles is added specific in the story and when used in CMS it has some slightly different styles:
umbraco/Umbraco-CMS#22917

When used in extend of backoffice, e.g. in the property editor or a dashboard, developers have to copy these prepend/append styles, which is difficult to maintain if Umbraco later change the look and feel of this.

I considered it to be added in CMS, but I think it belong to UI library and easier for other addons like Forms, Deploy, Commerce to benefits from this.

Another downside it that it only uui-input component support this, it doesn't allow to combine this with uui-select.
An use case for this can be seen here: https://primevue.org/inputgroup/#basic

Prepend may still make sense inside uui-input e.g. search icon in input:
http://localhost:6006/?path=/story/uui-input--prepend-icon

With the uui-input-group we can also other components as addon, e.g. a uui-color-swatch in prepend slot or a uui-button in append slot.

I am considering if it would be best to always wrap prepend/append insider uui-input-group-addon (it may be easier to control rounding, e.g. if custom components can be used insider this as well) or if e.g. uui-button can be added directly.
I think the former may be easier to control.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Motivation and context

How to test?

Screenshots (if appropriate)

image

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@github-actions
Copy link
Copy Markdown

Hi there @bjarnef, thank you for this contribution! 👍

While we wait for the team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@bjarnef bjarnef marked this pull request as ready for review May 25, 2026 08:28
Copilot AI review requested due to automatic review settings May 25, 2026 08:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds new uui-input-group and uui-input-group-addon web components (Lit) plus Storybook stories, README docs, and basic tests, and exports them from the components index.

Changes:

  • Introduces uui-input-group + uui-input-group-addon elements with base styling for grouped controls.
  • Adds Storybook stories/examples (including a select-based example) and component READMEs.
  • Adds Vitest tests (instance + axe a11y) and exports the components via src/components/index.ts.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/components/input-group/input-group.ts Registers uui-input-group and re-exports the element class.
src/components/input-group/input-group.element.ts Implements UUIInputGroupElement and group styling rules.
src/components/input-group/input-group.story.ts Adds Storybook stories demonstrating input-group usage patterns.
src/components/input-group/input-group-select.example.ts Adds a Storybook example element combining addon + select.
src/components/input-group/input-group.test.ts Adds basic instantiation and a11y tests for input-group.
src/components/input-group/README.md Documents usage/import for uui-input-group.
src/components/input-group-addon/input-group-addon.ts Registers uui-input-group-addon and re-exports the element class.
src/components/input-group-addon/input-group-addon.element.ts Implements UUIInputGroupAddonElement styles + slot rendering.
src/components/input-group-addon/input-group-addon.story.ts Adds Storybook stories for addon.
src/components/input-group-addon/input-group-addon.test.ts Adds basic instantiation and a11y tests for addon.
src/components/input-group-addon/README.md Documents usage/import for uui-input-group-addon.
src/components/index.ts Exports the new components from the package index.

}

#onChange = (e: UUISelectEvent) => {
this.value = e.target.value as string;
Comment on lines +81 to +86

/* not last addon → remove RIGHT border (only if another addon follows) */
::slotted(uui-input-group-addon:not(:last-child)),
::slotted(uui-button:not(:last-child)) {
border-right: none;
}
Comment on lines +29 to +31
html`<uui-input-group ${spread(args)}
>${renderSlots(args)}</uui-input-group
>`,
import { html } from 'lit';
import { render } from 'vitest-browser-lit';
import { axeRun } from '../../internal/test/a11y.js';
import { UUIInputGroupElement } from './input-group.element';
Comment thread src/components/input-group/input-group.story.ts Outdated
@bjarnef
Copy link
Copy Markdown
Contributor Author

bjarnef commented May 25, 2026

A bit more polishing and not quite sure how to use non-essential icons in the stories.

I think it would make to allow a uui-button to be added directly in input group similar to this:
https://ui.nuxt.com/docs/components/field-group

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants