Skip to content

571- adding responsive preview option#572

Merged
flacoman91 merged 4 commits into
mainfrom
rad-responsive-preview
May 11, 2026
Merged

571- adding responsive preview option#572
flacoman91 merged 4 commits into
mainfrom
rad-responsive-preview

Conversation

@flacoman91
Copy link
Copy Markdown
Collaborator

@flacoman91 flacoman91 commented May 10, 2026

Addresses: #571
Adds responsive previews as an option in the storybook interface to view them all at one time.

To test, go to a story, (You can't be on the overview page for a component since thats just a documentation page) select all viewports from the dropdown.
https://cfpb.github.io/design-system-react/pr-previews/pr-572/?path=/story/components-draft-heroes--with-illustration&globals=viewport.isRotated:!false

Screenshot 2026-05-10 at 4 18 52 PM

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 10, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-11 18:59 UTC

@flacoman91 flacoman91 marked this pull request as ready for review May 10, 2026 23:34
Comment thread .storybook/preview.js
Comment on lines +8 to +33
const viewportOptions = {
phone: {
name: 'Phone',
styles: {
width: '390px',
height: '844px',
},
type: 'mobile',
},
tablet: {
name: 'Tablet',
styles: {
width: '768px',
height: '1024px',
},
type: 'tablet',
},
desktop: {
name: 'Desktop',
styles: {
width: '1280px',
height: '900px',
},
type: 'desktop',
},
};
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@natalia-fitzgerald

can you give the specific widths you want for the various device breakpoints to appear?

@flacoman91 flacoman91 changed the title adding responsive preview option 571- adding responsive preview option May 10, 2026
@flacoman91 flacoman91 enabled auto-merge (squash) May 11, 2026 18:35
Copy link
Copy Markdown
Collaborator

@natalia-fitzgerald natalia-fitzgerald left a comment

Choose a reason for hiding this comment

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

@flacoman91
This is looking great and I can already see the benefit of being able to see the different breakpoints (as shown below).

I noticed a few issues with the way the hero is rendering in Storybook. I will open up a separate ticket to handle these issues.

In the hero with illustration:

  • The hero image is filling the width and the height of the container.
  • The illustration dimensions should be 470px wide (exact) and 195px high (maximum) (2x: 940px x 390px).

In the hero with photograph:

  • The photograph is not rendering.

In the jumbo hero:

  • Photo dimensions for small screens should be 600px (exact) x 338px (maximum) but it is rendering as 566px x 342.35px.

@flacoman91 flacoman91 merged commit 648f939 into main May 11, 2026
3 checks passed
@flacoman91 flacoman91 deleted the rad-responsive-preview branch May 11, 2026 18:58
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.

2 participants