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

Add anchors to refer examples #125

Open
fernahh opened this issue Sep 7, 2019 · 1 comment
Open

Add anchors to refer examples #125

fernahh opened this issue Sep 7, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@fernahh
Copy link

fernahh commented Sep 7, 2019

Problem:

Sometimes we need to share one specific component example. Today it's not a good experience when this component has many examples.

Solution:

Add an anchor on example title.

Examples:

I've liked of SHAPE UP style, where the anchor icon has been showing just on mouseover:

2019-09-07 15 55 19

There another example of rbx with a hash:
2019-09-07 16 02 38

@rafaelcamargo what you think about it?

@rafaelcamargo rafaelcamargo added the enhancement New feature or request label Sep 8, 2019
@rafaelcamargo
Copy link
Member

Would be awesome! ✌️

Since Pitsby has a path always starting with /#!/, we'll have to use a different strategy than that used by Shape Up. We might define a search param on url to handle that. Suggestion:

?example=1

So the value might be the index of the example. Doing so, when the component <p-external-component-examples-list> gets rendered, it looks for the search param and, if it finds that, it scrolls the window to the specific example. It' important to notice that on mobile we'll have to add an offset relating the Topbar's height.

What are your thoughts?

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

No branches or pull requests

2 participants