Loading
Unbox count in buttons
What does this MR do?
Simplifies the count by unboxing it. Currently it mimics a badge but most consumers in the product use a custom integration to unbox it.
Changes:
- Tweaks how the count looks by unboxing it
button.vuehasIconOnlyno longer depends oncount, so a button withicon+countand no text getsbtn-icon.- The
.gl-button-countelement now renders outside.gl-button-text, so it also shows for icon-only buttons. - A new
btn-countclass is applied whenever a count is shown.
button.scss- Count is now unboxed with
gl-font-semibold - New
.btn-icon.btn-countand.btn-sm.btn-icon.btn-countpadding rules for optical alignment with the icon-only buttons. The count spacing drops togl-ml-2here.
- Count is now unboxed with
- Docs: adds icon + count examples (medium and small) to
contents/components/button.md. - Specs
- Updated the spec that expected icon + count to not be icon-only. It now asserts
btn-icon. - Added specs for:
- where the count renders (outside the button text)
- the count rendering on icon-only buttons
- when the
btn-countclass is applied (count with text,0, icon-only,null, undefined, no count, negative)
- Updated the spec that expected icon + count to not be icon-only. It now asserts
- Changeset:
@gitlab/uipatch.
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
| Icon-only button adjustments | |
![]() |
|
![]() |
Integrations
- GitLab: Draft: GitLab integration test for https://gitl... (gitlab-org/gitlab!263584)
- CustomersDot: mr_url
- Duo UI: mr_url
- Status Page: mr_url
- Docs: mr_url
- Switchboard: mr_url
Does this MR meet the acceptance criteria?
Toggle the acceptance checklist
Conformity
- The “What does this MR do?” section in the MR description is filled out.
- Relevant label(s) are applied to the MR.
- The MR is added to a milestone.
- Added the
~"component:*"label(s) if applicable. - A changeset is added when this MR will do a patch, minor, or major update.
Components
- GitLab UI's contributing guidelines.
- If the MR changes a component's API, integration MR(s) have been opened.
Accessibility
- All actions and functionality can be done with a keyboard.
- Links, buttons, and controls have a visible focus state.
- All content is presented in text or with a text equivalent (icon-only + count buttons still need an
aria-label). - Color combinations have sufficient contrast.
Edited by Design System Danger Token



