Skip to content

Added params to the button lookbook preview#485

Open
felp99 wants to merge 1 commit intobaoagency:mainfrom
felp99:button-playground-docs
Open

Added params to the button lookbook preview#485
felp99 wants to merge 1 commit intobaoagency:mainfrom
felp99:button-playground-docs

Conversation

@felp99
Copy link
Copy Markdown

@felp99 felp99 commented Mar 5, 2026

Related to #180

Add interactive playground to ButtonComponent preview

Adds a playground preview method to ButtonComponentPreview that allows developers to interactively explore all ButtonComponent options from the Lookbook UI.

Changes

  • Added playground method to ButtonComponentPreview with @param annotations for all supported button options (label, URL, icon, tooltip, size, alignment, disclosure, and all boolean toggles)
  • Added playground.html.erb template that renders a fully configured polaris_button using all the exposed parameters

Why

The existing previews each demonstrate a single feature in isolation. The playground gives developers a single interactive surface to combine any set of options and see the result live, which is useful for testing and exploration during development.

@kirillplatonov
Copy link
Copy Markdown
Collaborator

kirillplatonov commented Mar 12, 2026

Hey! Thanks for the PR.

To be honest, not sure how useful it is to have playground previews in Lookbook. The only value I see is to quickly try some settings. But you can't copy the final code with filled-in parameters.

CleanShot 2026-03-12 at 09 33 03@2x

In that sense regular preview methods are much more useful. You can see it visually and copy example code right away.

CleanShot 2026-03-12 at 09 27 59@2x

@felp99
Copy link
Copy Markdown
Author

felp99 commented Mar 12, 2026

My main idea was to show the developer the possibilities, since as it stands now we cannot clearly see everything that can be done in terms of parameters.

How would you do it?

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