Getting StartedComponentsDesign TokensThemingTheme SynthesizerFrameworksAccessibilityUtilitiesServer RenderingBrowser SupportContributingChangelog App ShellAspect GridAuth ShellCenterClusterContainerDashboard GridDockFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbar Anchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkSpeed DialStepper NavTabsTop BarTree View AccordionAspect RatioAvatarAvatar GroupCalloutCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSeparatorSkeletonSpinnerStackVideoVirtual List Activity HeatmapAnimated NumberBadgeChartClockComparisonCountdown TimerData GridData TableDescription ListDiffEvent CalendarGaugeJSON TreeKanbanKey ValueLevel MeterListMeterSparklineStatStepperTableTagTimelineUptimeValue CardWaveform BlockquoteCode BlockGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriter ButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputOTP InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree Select AlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuGuided TourHover CardInline MessageLoading OverlayModalNotification PanelPopoverProgressProgress ToastSheetSnackbarSpotlightToastTooltip
ARC UI ARC Radiant Components
v3.2 Docs Components Tokens Synthesizer
Getting StartedFrameworksServer Rendering Design TokensThemingTheme SynthesizerTypographyUtilities All ComponentsAccessibilityBrowser SupportChangelogContributingStats App ShellAspect GridAuth ShellCenterClusterContainerDashboard GridDockFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbar Anchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkSpeed DialStepper NavTabsTop BarTree View AccordionAspect RatioAvatarAvatar GroupCalloutCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSeparatorSkeletonSpinnerStackVideoVirtual List Activity HeatmapAnimated NumberBadgeChartClockComparisonCountdown TimerData GridData TableDescription ListDiffEvent CalendarGaugeJSON TreeKanbanKey ValueLevel MeterListMeterSparklineStatStepperTableTagTimelineUptimeValue CardWaveform BlockquoteCode BlockGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriter ButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputOTP InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree Select AlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuGuided TourHover CardInline MessageLoading OverlayModalNotification PanelPopoverProgressProgress ToastSheetSnackbarSpotlightToastTooltip

Scroll To Top

Floating button that appears after scrolling and smoothly returns the user to the top of the page.

Components Scroll To Top
navigation interactive
<arc-scroll-to-top>

Overview

ScrollToTop renders a fixed-position button that fades into view once the user scrolls past a configurable threshold (default 300px). Clicking it scrolls the page back to the top using the browser's native smooth scroll behavior. The component handles its own visibility state via a throttled passive scroll listener, so there is no setup required beyond placing the element in your page. The button uses a circular design with a chevron-up icon, positioned in the bottom-right corner by default. Both the corner placement and the edge offset are configurable via the `position` and `offset` properties. The show/hide animation uses opacity and translateY for a subtle fade-and-slide effect that feels native. Accessibility is built in: the button has `aria-label="Scroll to top"` and proper focus styles. The component also respects `prefers-reduced-motion` — when the user has opted out of motion, smooth scrolling is replaced with an instant jump and the CSS transition is disabled.

Guidelines

When to use

  • Place once at the page level, outside scrolling containers
  • Use on long pages where scrolling back to the top is common
  • Adjust the threshold for pages with different scroll depths
  • Pair with ScrollSpy for complete scroll navigation

When not to use

  • Do not place inside a scrollable container — it listens to window scroll
  • Do not add multiple ScrollToTop instances on the same page
  • Do not set the threshold too low — the button should appear after meaningful scrolling
  • Do not override the aria-label without providing an equivalent accessible name

Features

  • Auto show/hide based on scroll position with configurable threshold
  • Smooth scroll to top with `prefers-reduced-motion` fallback to instant
  • Passive, throttled scroll listener for zero layout thrashing
  • Configurable corner placement: bottom-right or bottom-left
  • Configurable edge offset via CSS length values
  • Circular button with chevron-up icon, fully token-styled
  • Accessible: `aria-label`, focus-visible glow, keyboard operable

Preview

Live on this page. Scroll down to see the button appear in the bottom-right corner, then click it to return here.

Usage

This component requires JavaScript. No pure HTML/CSS version is available — use the Web Component directly or a framework wrapper.

<!-- Place once at the page level -->
<arc-scroll-to-top></arc-scroll-to-top>

<!-- Custom threshold and position -->
<arc-scroll-to-top threshold="500" position="bottom-left"></arc-scroll-to-top>
import { ScrollToTop } from '@arclux/arc-ui-react';

export function Layout({ children }) {
  return (
    <>
      {children}
      <ScrollToTop threshold={400} />
    </>
  );
}
<script setup>
import { ScrollToTop } from '@arclux/arc-ui-vue';
</script>

<template>
  <main>
    <slot />
  </main>
  <ScrollToTop />
</template>
<script>
  import { ScrollToTop } from '@arclux/arc-ui-svelte';
</script>

<main>
  <slot />
</main>
<ScrollToTop />
import { Component } from '@angular/core';
import { ScrollToTop } from '@arclux/arc-ui-angular';

@Component({
  imports: [ScrollToTop],
  template: `
    <main>
      <ng-content></ng-content>
    </main>
    <arc-scroll-to-top></arc-scroll-to-top>
  `,
})
export class LayoutComponent {}
import { ScrollToTop } from '@arclux/arc-ui-solid';

export function Layout(props) {
  return (
    <>
      {props.children}
      <ScrollToTop />
    </>
  );
}
import { ScrollToTop } from '@arclux/arc-ui-preact';

export function Layout({ children }) {
  return (
    <>
      {children}
      <ScrollToTop />
    </>
  );
}

API

threshold number 300
Scroll distance in pixels before the button becomes visible.
smooth boolean true
Use smooth scrolling animation. Falls back to instant when prefers-reduced-motion is set.
position 'bottom-right' | 'bottom-left' 'bottom-right'
Corner placement.
offset string 'var(--space-lg)'
Distance from viewport edges. Accepts any CSS length value.

See Also