Merged
Conversation
Add a more generic suffix property to the Input component, which will replace the icon prop.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #327 +/- ##
==========================================
+ Coverage 91.99% 92.00% +0.01%
==========================================
Files 205 205
Lines 8447 8459 +12
Branches 1255 1254 -1
==========================================
+ Hits 7771 7783 +12
Misses 673 673
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add styling for Button components used as input suffix
20adc5e to
02d5398
Compare
This was referenced Mar 17, 2026
svenvandescheur
approved these changes
Mar 24, 2026
Collaborator
svenvandescheur
left a comment
There was a problem hiding this comment.
Code wise this looks OK, but I think maybe the button's styling can be improved to make it more clear that it's an interactive thing?
Collaborator
Author
|
I'll update the test to showcase the more prominent button variants (primary, secondary, transparent and accent). Regarding the central alignment, the input has an height that isn't dividable by 2. So the button spacing on the top is 1 pixel more than at the bottom. I'll check what can be done about this |
In order to centrally align the input suffix, the height of the input needs to be dividable by 2. By adding a round function to the input line-height, we can ensure this. Then, to properly showcase how the button suffix looks like, the storybook test has been updated to display the prominent variants (primary, secondary, accent and transparent).
When using a button as the suffix of an input component, we should support multiple size configurations. The input component receives inline-end padding based on the button size. This ensures that the input content remains fully readable when using any button size. For "nice" button/input spacing (ensuring that the spacing on the top, inline-end and bottom are the same), we use a specific inline-end for button suffix elements. For this styling we expect the input size and button size to be the same, providing support for each size combination will add a lot of complexity. When using the xxs variants of the button and input, the spacing above and below is reduced to zero. To prevent the button from covering the input border, we set the inline-end to 1px.
svenvandescheur
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #326
This PR aims to support the usage of Button components as Input suffix.
iconwithsuffix, to suggest a more generic usage.If we want a more generic implementation, where any element can be used as suffix, then a setup like the bootstrap input group might be more useful. With such an setup we could allow any size of suffix, and 'automatically' adjust the width of the input.