UNPKG

@amsterdam/design-system-react

Version:

All React components from the Amsterdam Design System. Use it to compose pages in your website or application.

10 lines (9 loc) 262 B
export const scrollToSlide = (id, ref) => { const element = ref.current?.children[id]; const scrollerElement = ref.current; if (!element || !scrollerElement) return; scrollerElement.scrollTo({ left: element.offsetLeft, }); };