Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple figma urls in a story #102

Closed
1 of 5 tasks
lazreg87 opened this issue May 28, 2021 · 4 comments
Closed
1 of 5 tasks

Support multiple figma urls in a story #102

lazreg87 opened this issue May 28, 2021 · 4 comments
Labels
category: feature New feature or request

Comments

@lazreg87
Copy link

Is your feature request related to a problem? Please describe.
Would be nice to be able to support multiple figma design urls in a single story, since Figma lets you link to specific nodes in the design.

Example usecase; be able to link to separate desktop and mobile design for one story

Describe the solution you'd like
Support multiple figma design urls per story

Describe alternatives you've considered
I could split the story into desktop and mobile, but since you can define viewports, this seems like overkill.

Design types

  • figma
  • experimental-figspec
  • link
  • image
  • iframe

Additional context
Add any other context or screenshots about the feature request here.

@lazreg87 lazreg87 added the category: feature New feature or request label May 28, 2021
@pocka
Copy link
Collaborator

pocka commented May 28, 2021

You can embed more than one design assets (not only Figma, also links, images, and iframes) into one story by passing an array of objects. (Example)

If you do so, I'd recommend you to set a tab name via the name property.

export const myStory = () => <MyComponent />

myStory.parameters = {
  design: [
    {
      name: 'Mobile',
      type: 'figma',
      url:
        'https://www.figma.com/file/Klm6pxIZSaJFiOMX5FpTul9F/storybook-addon-designs-sample',
    },
    {
      name: 'Desktop',
      type: 'figma',
      url:
        'https://www.figma.com/file/Klm6pxIZSaJFiOMX5FpTul9F/storybook-addon-designs-sample',
    },
  ],
}

@pocka pocka closed this as completed May 28, 2021
@sauldeleon
Copy link

sauldeleon commented Sep 10, 2021

Hi! I don't know if I should reopen this. Im having a problem when including multiple experimental-figspec designs.

Only the first one in the array list is loading properly. The second one seems like blocked and cant even scroll in the figma iframe

Also, when adding one figspec and one normal figma, it works correctly

@pocka
Copy link
Collaborator

pocka commented Sep 10, 2021

@sauldeleon
Can you open a new issue? It seems specific to figspec embed.

@sauldeleon
Copy link

Sure! here you go!
#122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants