Skip to content

Conversation

@francinelucca
Copy link
Member

@francinelucca francinelucca commented Jan 13, 2026

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

Changelog

New

  • added delay prop in SkeletonBox, along with docs, story and tests

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2026

🦋 Changeset detected

Latest commit: 6c39c2c

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jan 13, 2026
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot requested a deployment to storybook-preview-7448 January 13, 2026 05:13 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7448 January 13, 2026 05:23 Inactive
@francinelucca francinelucca marked this pull request as ready for review January 14, 2026 04:48
@francinelucca francinelucca requested a review from a team as a code owner January 14, 2026 04:48
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 customizable delay feature to the SkeletonBox component, allowing developers to control when skeleton loading states appear. The delay can be set to a boolean for a default 1000ms delay, or a custom number of milliseconds.

Changes:

  • Added delay prop to SkeletonBox with support for boolean or numeric values
  • Implemented delay logic using useState and useEffect with setTimeout (following the existing pattern from the Spinner component)
  • Added comprehensive test coverage for delay behavior with proper timer mocking
  • Added documentation and Storybook story for the new feature

Reviewed changes

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

Show a summary per file
File Description
packages/react/src/Skeleton/SkeletonBox.tsx Implements delay prop with useState/useEffect pattern, supporting both boolean and numeric delay values
packages/react/src/Skeleton/tests/SkeletonBox.test.tsx Adds test suite for delay behavior covering immediate render, delayed render, timeout cleanup, and timer advancement
packages/react/src/Skeleton/SkeletonBox.features.stories.tsx Adds WithDelay story to demonstrate the delay feature in Storybook
packages/react/src/Skeleton/SkeletonBox.docs.json Documents the new delay prop with type, description, and default value
.changeset/sweet-pets-breathe.md Adds changeset entry for the feature release

"props": [
{
"name": "delay",
"type": "boolean | 'number'",
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The type should be "boolean | number" without quotes around "number". The quotes make it a string literal type instead of the number type.

Suggested change
"type": "boolean | 'number'",
"type": "boolean | number",

Copilot uses AI. Check for mistakes.
Copy link
Member

@siddharthkp siddharthkp Jan 14, 2026

Choose a reason for hiding this comment

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

Because this is a new prop, should we try 'short' | 'long' | number? instead of boolean?

Bonus points if we can align it with Spinner delay

Copy link
Member Author

Choose a reason for hiding this comment

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

any thoughts on what short and long would translate to? 👀

Copy link
Member

@siddharthkp siddharthkp Jan 16, 2026

Choose a reason for hiding this comment

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

Looking at motion primitives: https://primer.style/primitives/storybook/?path=/story/motion-base--base

long is what we have now, 1000ms. I imagine short could one of 200, 300, 400 or 500ms. Not sure if @lukasoppermann already has a preference. I personally would pick 300 and run with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

implemented!

Copy link
Contributor

Copilot AI commented Jan 14, 2026

@francinelucca I've opened a new pull request, #7450, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

Approved because it matches Spinner.

Left a comment about my ideal API, but approving in advance in case you choose not to take the suggestion

Copilot AI and others added 3 commits January 14, 2026 22:34
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
@github-actions github-actions bot requested a deployment to storybook-preview-7448 January 15, 2026 03:41 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7448 January 15, 2026 03:51 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-7448 January 17, 2026 04:39 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7448 January 17, 2026 04:50 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-7448 January 21, 2026 05:04 Abandoned
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/11248

@primer-integration
Copy link

Integration test results from github/github-ui:

Passed  CI   Passed
Running  VRT   Running
Passed  Projects   Passed

@francinelucca francinelucca added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 838859d Jan 21, 2026
54 of 55 checks passed
@francinelucca francinelucca deleted the feat/add-delay-to-skeletonbox branch January 21, 2026 08:10
@primer primer bot mentioned this pull request Jan 21, 2026
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 staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants