Skip to content

fix(skeleton): fixed shimmer animation still plays when disableAnimation is true#5916

Merged
wingkwong merged 5 commits into
heroui-inc:canaryfrom
hasegawa-101:issue-5915
Nov 21, 2025
Merged

fix(skeleton): fixed shimmer animation still plays when disableAnimation is true#5916
wingkwong merged 5 commits into
heroui-inc:canaryfrom
hasegawa-101:issue-5915

Conversation

@hasegawa-101
Copy link
Copy Markdown

@hasegawa-101 hasegawa-101 commented Nov 19, 2025

Closes #5915

📝 Description

Fixed an issue where the skeleton shimmer animation was still playing even when disableAnimation prop was set to true.

⛳️ Current behavior (updates)

The skeleton component's shimmer animation continues to play regardless of the disableAnimation prop value. This happens because before:animate-shimmer was always applied in the base slot, and the variant's before:animate-none couldn't properly override it due to Tailwind CSS class ordering and specificity issues.

🚀 New behavior

When disableAnimation is set to true, the shimmer animation is now completely disabled. The fix moves before:animate-shimmer from the base slot to the disableAnimation: false variant, ensuring proper animation control based on the prop value.

2025-11-19.23.48.15.mov

💣 Is this a breaking change (Yes/No):

No.

📝 Additional Information

Summary by CodeRabbit

  • Bug Fixes
    • Fixed skeleton shimmer animation to properly respect the disableAnimation prop.
  • Chores
    • Added a changeset entry to mark patch releases.
    • Bumped the theme peer dependency requirement for the skeleton package.
  • Documentation
    • Storybook skeleton example now forwards controls so props (e.g., isLoaded, disableAnimation) affect the standalone preview.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: b363806

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

This PR includes changesets to release 14 packages
Name Type
@heroui/theme Patch
@heroui/skeleton Patch
@heroui/autocomplete Patch
@heroui/checkbox Patch
@heroui/date-input Patch
@heroui/date-picker Patch
@heroui/form Patch
@heroui/input-otp Patch
@heroui/input Patch
@heroui/number-input Patch
@heroui/radio Patch
@heroui/select Patch
@heroui/table Patch
@heroui/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

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 19, 2025

@hasegawa-101 is attempting to deploy a commit to the HeroUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 19, 2025

Walkthrough

Patch adjusting Skeleton so the shimmer animation respects the disableAnimation prop by moving the animation class into the variant configuration and updating peer dependency and story usage. No exported API signatures changed. (≤50 words)

Changes

Cohort / File(s) Summary
Changeset Entry
\.changeset/tiny-hairs-collect.md
Adds a changeset noting patch bumps for @heroui/theme and @heroui/skeleton, and that the skeleton shimmer animation now respects disableAnimation.
Skeleton theme variant
packages/core/theme/src/components/skeleton.ts
Moves the before:animate-shimmer Tailwind token out of the base slot into the false variant's base configuration so the shimmer applies only when disableAnimation is false (and before:animate-none remains when true).
Package peerDependency
packages/components/skeleton/package.json
Bumps peer dependency requirement for @heroui/theme from >=2.4.17 to >=2.4.23.
Storybook usage
packages/components/skeleton/stories/skeleton.stories.tsx
StandaloneTemplate now forwards ...args to Skeleton, allowing external props (e.g., disableAnimation, isLoaded) to control the standalone story instance.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer / Story
  participant Story as Storybook Template
  participant Skeleton as Skeleton Component
  participant Theme as Themed Variant Config
  participant DOM as Rendered Element

  Dev->>Story: set args (disableAnimation = true/false)
  Story->>Skeleton: render Skeleton with ...args
  Skeleton->>Theme: resolve variant for disableAnimation
  alt disableAnimation = false
    Theme-->>Skeleton: include before:animate-shimmer
  else disableAnimation = true
    Theme-->>Skeleton: include before:animate-none
  end
  Skeleton->>DOM: render classes -> (shimmer on/off)
  Note over DOM: visual animation reflects variant result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check variant logic in packages/core/theme/src/components/skeleton.ts for correctness and no regressions.
  • Verify story change correctly forwards props and Storybook displays both states.
  • Ensure peerDependency bump is compatible and package builds/tests pass.

Suggested reviewers

  • jrgarciadev

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: resolving an issue where skeleton shimmer animation was playing despite disableAnimation being true.
Description check ✅ Passed The description is comprehensive and follows the template structure, including issue reference, current behavior, new behavior, breaking change status, and supporting media.
Linked Issues check ✅ Passed The code changes directly address the linked issue #5915 by moving before:animate-shimmer from base slot to the disableAnimation: false variant, ensuring the animation is properly disabled when the prop is true.
Out of Scope Changes check ✅ Passed All changes are narrowly focused on fixing the skeleton disableAnimation bug: theme token reordering, peer dependency update, and storybook props forwarding to enable proper testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5640136 and b363806.

📒 Files selected for processing (3)
  • .changeset/tiny-hairs-collect.md (1 hunks)
  • packages/components/skeleton/package.json (1 hunks)
  • packages/components/skeleton/stories/skeleton.stories.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/tiny-hairs-collect.md
🧰 Additional context used
🧬 Code graph analysis (1)
packages/components/skeleton/stories/skeleton.stories.tsx (1)
packages/components/image/stories/image.stories.tsx (1)
  • Skeleton (140-151)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Continuous Release
  • GitHub Check: ESLint
  • GitHub Check: TypeScript
  • GitHub Check: Build
🔇 Additional comments (2)
packages/components/skeleton/stories/skeleton.stories.tsx (1)

59-59: LGTM! Props forwarding now consistent across all Skeleton instances.

Adding {...args} ensures that Storybook controls (including disableAnimation) affect all three Skeleton instances in the StandaloneTemplate, aligning with the pattern used in lines 62-63 and in other templates.

packages/components/skeleton/package.json (1)

39-39: Verification confirmed: Theme version 2.4.23 contains the shimmer animation fix.

The theme package version matches the peer dependency requirement (2.4.23), and the skeleton theme configuration confirms that before:animate-shimmer has been properly moved into the disableAnimation variant configuration (applied when disableAnimation: false), not in the base slots. This aligns with the PR objectives.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Nov 19, 2025

Open in StackBlitz

@heroui/accordion

npm i https://pkg.pr.new/@heroui/accordion@5916

@heroui/alert

npm i https://pkg.pr.new/@heroui/alert@5916

@heroui/autocomplete

npm i https://pkg.pr.new/@heroui/autocomplete@5916

@heroui/avatar

npm i https://pkg.pr.new/@heroui/avatar@5916

@heroui/badge

npm i https://pkg.pr.new/@heroui/badge@5916

@heroui/breadcrumbs

npm i https://pkg.pr.new/@heroui/breadcrumbs@5916

@heroui/button

npm i https://pkg.pr.new/@heroui/button@5916

@heroui/calendar

npm i https://pkg.pr.new/@heroui/calendar@5916

@heroui/card

npm i https://pkg.pr.new/@heroui/card@5916

@heroui/checkbox

npm i https://pkg.pr.new/@heroui/checkbox@5916

@heroui/chip

npm i https://pkg.pr.new/@heroui/chip@5916

@heroui/code

npm i https://pkg.pr.new/@heroui/code@5916

@heroui/date-input

npm i https://pkg.pr.new/@heroui/date-input@5916

@heroui/date-picker

npm i https://pkg.pr.new/@heroui/date-picker@5916

@heroui/divider

npm i https://pkg.pr.new/@heroui/divider@5916

@heroui/drawer

npm i https://pkg.pr.new/@heroui/drawer@5916

@heroui/dropdown

npm i https://pkg.pr.new/@heroui/dropdown@5916

@heroui/form

npm i https://pkg.pr.new/@heroui/form@5916

@heroui/image

npm i https://pkg.pr.new/@heroui/image@5916

@heroui/input

npm i https://pkg.pr.new/@heroui/input@5916

@heroui/input-otp

npm i https://pkg.pr.new/@heroui/input-otp@5916

@heroui/kbd

npm i https://pkg.pr.new/@heroui/kbd@5916

@heroui/link

npm i https://pkg.pr.new/@heroui/link@5916

@heroui/listbox

npm i https://pkg.pr.new/@heroui/listbox@5916

@heroui/menu

npm i https://pkg.pr.new/@heroui/menu@5916

@heroui/modal

npm i https://pkg.pr.new/@heroui/modal@5916

@heroui/navbar

npm i https://pkg.pr.new/@heroui/navbar@5916

@heroui/number-input

npm i https://pkg.pr.new/@heroui/number-input@5916

@heroui/pagination

npm i https://pkg.pr.new/@heroui/pagination@5916

@heroui/popover

npm i https://pkg.pr.new/@heroui/popover@5916

@heroui/progress

npm i https://pkg.pr.new/@heroui/progress@5916

@heroui/radio

npm i https://pkg.pr.new/@heroui/radio@5916

@heroui/ripple

npm i https://pkg.pr.new/@heroui/ripple@5916

@heroui/scroll-shadow

npm i https://pkg.pr.new/@heroui/scroll-shadow@5916

@heroui/select

npm i https://pkg.pr.new/@heroui/select@5916

@heroui/skeleton

npm i https://pkg.pr.new/@heroui/skeleton@5916

@heroui/slider

npm i https://pkg.pr.new/@heroui/slider@5916

@heroui/snippet

npm i https://pkg.pr.new/@heroui/snippet@5916

@heroui/spacer

npm i https://pkg.pr.new/@heroui/spacer@5916

@heroui/spinner

npm i https://pkg.pr.new/@heroui/spinner@5916

@heroui/switch

npm i https://pkg.pr.new/@heroui/switch@5916

@heroui/table

npm i https://pkg.pr.new/@heroui/table@5916

@heroui/tabs

npm i https://pkg.pr.new/@heroui/tabs@5916

@heroui/toast

npm i https://pkg.pr.new/@heroui/toast@5916

@heroui/tooltip

npm i https://pkg.pr.new/@heroui/tooltip@5916

@heroui/user

npm i https://pkg.pr.new/@heroui/user@5916

@heroui/react

npm i https://pkg.pr.new/@heroui/react@5916

@heroui/system

npm i https://pkg.pr.new/@heroui/system@5916

@heroui/system-rsc

npm i https://pkg.pr.new/@heroui/system-rsc@5916

@heroui/theme

npm i https://pkg.pr.new/@heroui/theme@5916

@heroui/use-aria-accordion

npm i https://pkg.pr.new/@heroui/use-aria-accordion@5916

@heroui/use-aria-accordion-item

npm i https://pkg.pr.new/@heroui/use-aria-accordion-item@5916

@heroui/use-aria-button

npm i https://pkg.pr.new/@heroui/use-aria-button@5916

@heroui/use-aria-link

npm i https://pkg.pr.new/@heroui/use-aria-link@5916

@heroui/use-aria-modal-overlay

npm i https://pkg.pr.new/@heroui/use-aria-modal-overlay@5916

@heroui/use-aria-multiselect

npm i https://pkg.pr.new/@heroui/use-aria-multiselect@5916

@heroui/use-aria-overlay

npm i https://pkg.pr.new/@heroui/use-aria-overlay@5916

@heroui/use-callback-ref

npm i https://pkg.pr.new/@heroui/use-callback-ref@5916

@heroui/use-clipboard

npm i https://pkg.pr.new/@heroui/use-clipboard@5916

@heroui/use-data-scroll-overflow

npm i https://pkg.pr.new/@heroui/use-data-scroll-overflow@5916

@heroui/use-disclosure

npm i https://pkg.pr.new/@heroui/use-disclosure@5916

@heroui/use-draggable

npm i https://pkg.pr.new/@heroui/use-draggable@5916

@heroui/use-form-reset

npm i https://pkg.pr.new/@heroui/use-form-reset@5916

@heroui/use-image

npm i https://pkg.pr.new/@heroui/use-image@5916

@heroui/use-infinite-scroll

npm i https://pkg.pr.new/@heroui/use-infinite-scroll@5916

@heroui/use-intersection-observer

npm i https://pkg.pr.new/@heroui/use-intersection-observer@5916

@heroui/use-is-mobile

npm i https://pkg.pr.new/@heroui/use-is-mobile@5916

@heroui/use-is-mounted

npm i https://pkg.pr.new/@heroui/use-is-mounted@5916

@heroui/use-measure

npm i https://pkg.pr.new/@heroui/use-measure@5916

@heroui/use-pagination

npm i https://pkg.pr.new/@heroui/use-pagination@5916

@heroui/use-real-shape

npm i https://pkg.pr.new/@heroui/use-real-shape@5916

@heroui/use-ref-state

npm i https://pkg.pr.new/@heroui/use-ref-state@5916

@heroui/use-resize

npm i https://pkg.pr.new/@heroui/use-resize@5916

@heroui/use-safe-layout-effect

npm i https://pkg.pr.new/@heroui/use-safe-layout-effect@5916

@heroui/use-scroll-position

npm i https://pkg.pr.new/@heroui/use-scroll-position@5916

@heroui/use-ssr

npm i https://pkg.pr.new/@heroui/use-ssr@5916

@heroui/use-theme

npm i https://pkg.pr.new/@heroui/use-theme@5916

@heroui/use-update-effect

npm i https://pkg.pr.new/@heroui/use-update-effect@5916

@heroui/use-viewport-size

npm i https://pkg.pr.new/@heroui/use-viewport-size@5916

@heroui/aria-utils

npm i https://pkg.pr.new/@heroui/aria-utils@5916

@heroui/dom-animation

npm i https://pkg.pr.new/@heroui/dom-animation@5916

@heroui/framer-utils

npm i https://pkg.pr.new/@heroui/framer-utils@5916

@heroui/react-rsc-utils

npm i https://pkg.pr.new/@heroui/react-rsc-utils@5916

@heroui/react-utils

npm i https://pkg.pr.new/@heroui/react-utils@5916

@heroui/shared-icons

npm i https://pkg.pr.new/@heroui/shared-icons@5916

@heroui/shared-utils

npm i https://pkg.pr.new/@heroui/shared-utils@5916

@heroui/stories-utils

npm i https://pkg.pr.new/@heroui/stories-utils@5916

@heroui/test-utils

npm i https://pkg.pr.new/@heroui/test-utils@5916

commit: b363806

@hasegawa-101 hasegawa-101 marked this pull request as ready for review November 19, 2025 15:24
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/core/theme/src/components/skeleton.ts (1)

63-63: No functional issue found; the component already provides correct defaults through the hook.

The disableAnimation default is already handled correctly in packages/components/skeleton/src/use-skeleton.ts (line 48):

const disableAnimation = originalProps.disableAnimation ?? globalContext?.disableAnimation ?? false;

Since the component hook always computes and explicitly passes disableAnimation to the variant (line 52-54), the variant's empty defaultVariants is never used in practice. The shimmer animation already plays by default when disableAnimation is undefined, maintaining backward compatibility.

The suggested change to add defaultVariants: { disableAnimation: false } would be purely cosmetic—it would not affect current behavior but could improve code clarity by making the default explicit at the variant level. This is optional.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8921dc4 and 5640136.

📒 Files selected for processing (2)
  • .changeset/tiny-hairs-collect.md (1 hunks)
  • packages/core/theme/src/components/skeleton.ts (1 hunks)
🔇 Additional comments (2)
.changeset/tiny-hairs-collect.md (1)

1-5: LGTM! Changeset properly documents the bug fix.

The changeset correctly marks this as a patch-level change and clearly describes the fix for the shimmer animation issue.

packages/core/theme/src/components/skeleton.ts (1)

58-58: Correctly moves shimmer animation to the false variant.

This fix properly addresses the Tailwind CSS specificity issue by conditionally applying the shimmer animation only when disableAnimation is false.

@wingkwong wingkwong self-assigned this Nov 19, 2025
@wingkwong wingkwong added this to the v2.8.6 milestone Nov 19, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
heroui Ready Ready Preview Comment Nov 21, 2025 2:56am
heroui-sb Ready Ready Preview Comment Nov 21, 2025 2:56am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - disableAnimation does not work on Skeleton

2 participants