Add small (24px) size variant to nimble-chip#2896
Draft
fredvisser wants to merge 2 commits intomainfrom
Draft
Conversation
Add a 'size' attribute to the chip component with two values: - 'normal' (default, undefined): 32px height (existing behavior) - 'small': 24px height using controlSlimHeight token This is a non-breaking change. Existing chips without a size attribute continue to render at 32px. Changes: - Add ChipSize enum to chip/types.ts - Add size attribute to Chip class - Add sizeBehavior utility (mirrors appearanceBehavior pattern) - Update styles with controlSlimHeight for small variant - Add unit tests for size attribute - Update Storybook stories and matrix with size states - Update Angular directive with size property and tests
rajsite
reviewed
Mar 14, 2026
Member
There was a problem hiding this comment.
@fredvisser sizing is done via css and not attributes. Controls should respond to sizing via css. See spinner sizing docs as an example: https://nimble.ni.dev/storybook/index.html?path=/docs/components-spinner--docs&globals=backgrounds.grid:!true
Member
There was a problem hiding this comment.
See the "current direction" section captured here: #610
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.
Pull Request
🤨 Rationale
The
nimble-chipcomponent only supported a single 32px height although we have designs for a 24px variation, and it's required by other recent app designs.👩💻 Implementation
Added a
sizeattribute tonimble-chipwith two values:normal(default,undefined): 32px height — existing behavior, no attribute renderedsmall: 24px height via thecontrolSlimHeighttokenSame font and horizontal padding as the normal variant; only the height changes.
Key files and changes:
packages/nimble-components/src/chip/types.ts— newChipSizeenumpackages/nimble-components/src/chip/index.ts—sizeattribute onChipclasspackages/nimble-components/src/chip/styles.ts—sizeBehaviorfor small height overridepackages/nimble-components/src/utilities/style/size.ts— newsizeBehaviorutility, mirrors the existingappearanceBehaviorpackages/nimble-components/src/utilities/style/size.ts— newsizeBehaviorutility, mirrors the existingappearanceBehaviorpackages/nimble-components/src/utilities/style/size.ts— newsizeBehaviorutility, mirrors the existingappearancult value, setting tosmall, resetting tonormal`sizeStatesto the chip matrix story so visual regression tests cover both sizesRichTextEditor keyboard shortcutsand are unrelated to this change✅ Checklist