mauricevancooten / react-anchor-link-smooth-scroll

React component for anchor links using the smooth scroll polyfill.
243 stars 31 forks source link

Offset settings for different viewport #4

Closed imshuffling closed 6 years ago

imshuffling commented 6 years ago

Would be cool if we could adjust the offset for different viewports.

e.g. <AnchorLink offset='205' offset-sm='210' className="btn nav-item" href='#speakers'>Speakers</AnchorLink>

Thoughts?

mauricevancooten commented 6 years ago

I can see how that could be more dynamic. We'd also need to specify the breakpoints.

drochag commented 6 years ago

Maybe a function would be nicer, so anyone could adjust offset according to needs, something like

<AnchorLink offset={() => someCalc()} />