Skip to content

Conversation

@dev-rohit-gupta
Copy link

Proposed changes (including videos or screenshots)

This PR fixes an issue where the Args/Props table inside the Storybook Docs view overflows horizontally on mobile viewports.

On smaller screens, some table cells (for example union types, generic types, and the controls column) force the table to exceed the viewport width. Since the table is not wrapped in a scrollable container, the entire Docs page becomes horizontally scrollable instead of just the table, which breaks the mobile layout.

To fix this, a scoped CSS rule is added so that only the direct wrapper of the Args/Props table becomes horizontally scrollable:

*:has(> .docblock-argstable) {
  width: 100%;
  overflow-x: auto;
  display: block;
}

This rule is applied globally through the Storybook Docs layer (.storybook/preview.js), so it reliably affects all component Docs pages without requiring changes to individual component stories.

Result:

  1. The Args/Props table scrolls horizontally within its own container on small screens.
  2. The rest of the Docs page no longer overflows horizontally.
  3. Desktop behavior is unchanged.

Before (bug):

image

After (fix):

image

Issue(s)

closes : #1795

Further comments

On mobile, an even better UX might be to render the Args/Props information as an accordion instead of a wide table, so that each prop can be expanded/collapsed individually. That would require customizing how the Storybook Docs addon renders the Args table, so this PR focuses only on the minimal and safe CSS fix for the current layout.

Copilot AI review requested due to automatic review settings December 8, 2025 17:10
@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2025

⚠️ No Changeset found

Latest commit: 0440ae8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

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 fixes a mobile responsive layout issue in Storybook documentation pages where the Args/Props table causes horizontal overflow of the entire page. The solution adds a scoped CSS rule that makes only the table's parent container horizontally scrollable, preserving the proper layout on mobile devices.

Key Changes

  • Added a new SCSS file with a CSS rule targeting the Args table wrapper using the :has() pseudo-class
  • Imported the SCSS file in the Storybook preview configuration to apply globally to all Docs pages

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/fuselage/.storybook/preview.tsx Added import for the new docs-overrides.scss file to apply global Docs styling
packages/fuselage/.storybook/docs-overrides.scss New file containing CSS rule to make Args table container scrollable on overflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dev-rohit-gupta dev-rohit-gupta force-pushed the fix/docs-mobile-overflow branch 2 times, most recently from 9c5408b to f993d8f Compare December 9, 2025 01:36
@tassoevan tassoevan requested a review from a team December 9, 2025 03:32
@tassoevan tassoevan changed the title fix(fuselage): prevent horizontal overflow of Docs Args table on mobile docs(fuselage): prevent horizontal overflow of Docs Args table on mobile Dec 9, 2025
@dev-rohit-gupta dev-rohit-gupta force-pushed the fix/docs-mobile-overflow branch from f993d8f to e557b03 Compare December 11, 2025 03:07
@dev-rohit-gupta dev-rohit-gupta force-pushed the fix/docs-mobile-overflow branch from e557b03 to 0440ae8 Compare December 15, 2025 00:36
@dev-rohit-gupta
Copy link
Author

Hi @tassoevan I have ensured all checks are passing and the branch is up to date. Please let me know if any further changes are required. Thanks!

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.

Docs: Args table overflows on mobile and causes horizontal page scroll

2 participants