Skip to content

Conversation

@pksjce
Copy link
Contributor

@pksjce pksjce commented Oct 14, 2025

Closes https://github.com/github/primer/issues/5980

Changelog

The gap between the icons in ActionBar was always 8. Now we can customise

New

Screenshot 2025-10-14 at 3 38 13 pm

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@pksjce pksjce requested a review from a team as a code owner October 14, 2025 04:39
@pksjce pksjce requested review from TylerJDev and Copilot October 14, 2025 04:39
@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2025

🦋 Changeset detected

Latest commit: eb7541e

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

This PR includes changesets to release 2 packages
Name Type
@primer/react Patch
@primer/styled-react Patch

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

Copy link
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

This PR adds a new gap prop to the ActionBar component to allow customizable spacing between items, with a default of 8 pixels. The implementation includes proper prop validation to cap the gap at 8 pixels maximum and 0 pixels minimum to maintain design consistency.

  • Adds gap prop to ActionBar with documentation and validation
  • Updates internal calculation functions to use the customizable gap value
  • Provides Storybook examples demonstrating different gap values

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/react/src/ActionBar/ActionBar.tsx Adds gap prop with validation logic and updates all spacing calculations to use the custom gap
packages/react/src/ActionBar/ActionBar.stories.tsx Adds Storybook controls and examples showcasing different gap values

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

Uh oh! @pksjce, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:

  • Images should have meaningful alternative text (alt text) at line 15

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 14, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7000 October 14, 2025 04:49 Inactive
Add gap prop to ActionBar for customizable spacing between items
@github-actions github-actions bot temporarily deployed to storybook-preview-7000 October 14, 2025 10:59 Inactive
const {size = 'medium', children, 'aria-label': ariaLabel, flush = false, className} = props
const {size = 'medium', children, 'aria-label': ariaLabel, flush = false, className, gap} = props

const itemGap = Math.min(Math.max(gap ?? ACTIONBAR_ITEM_GAP, 0), ACTIONBAR_ITEM_GAP)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This keeps it between 0 and 8

Comment on lines 103 to 104

// GapExamples story moved to examples (Next.js example page) to reduce Storybook surface area.
Copy link
Member

Choose a reason for hiding this comment

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

is this accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh no!

</ActionBar>
)

export const GapScale = () => (
Copy link
Member

Choose a reason for hiding this comment

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

should we add this to VRT?

@pksjce pksjce enabled auto-merge October 16, 2025 04:31
@github-actions github-actions bot requested a deployment to storybook-preview-7000 October 16, 2025 04:33 Abandoned
@pksjce pksjce added this pull request to the merge queue Oct 16, 2025
Merged via the queue into main with commit 34e7fa8 Oct 16, 2025
42 checks passed
@pksjce pksjce deleted the pk/actionbar-gap branch October 16, 2025 04:45
@primer primer bot mentioned this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants