// Generated by scripts/generate-showcase.mjs. Do not edit directly. page BackToTopDetail { layout = "showcase" state playground_threshold = Number(ctx.url.searchParams.get("pg_threshold") ?? "500") state playground_label = ctx.url.searchParams.get("pg_label") ?? "Back to top" state playground_ariaLabel = ctx.url.searchParams.get("pg_ariaLabel") ?? "Scroll back to top" state playground_icon = ctx.url.searchParams.get("pg_icon") ?? "icon-[lucide--arrow-up]" state playground_position = ctx.url.searchParams.get("pg_position") ?? "right" state playground_offset = ctx.url.searchParams.get("pg_offset") ?? "md" state playground_behavior = ctx.url.searchParams.get("pg_behavior") ?? "smooth" state playground_showProgress = (ctx.url.searchParams.get("pg_showProgress") ?? "false") === "true" state playground_showLabel = (ctx.url.searchParams.get("pg_showLabel") ?? "false") === "true" state playground_alwaysVisible = (ctx.url.searchParams.get("pg_alwaysVisible") ?? "true") === "true" state playground_size = ctx.url.searchParams.get("pg_size") ?? "default" state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary" state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "solid" state playground_shape = ctx.url.searchParams.get("pg_shape") ?? "round" state playground_class = ctx.url.searchParams.get("pg_class") ?? "" seo { title = "Back To Top" description = "Provide a responsive floating control that returns long pages to the top and can show scroll progress." } view {
Navigation component

Back To Top

Provide a responsive floating control that returns long pages to the top and can show scroll progress.

15 props0 slots0 outputsTheme readyResponsive
Interactive playground

Configure Back To Top

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
<BackToTop />
Component props15 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Floating round control

Return visitors to the top of a long page after the scroll threshold is reached.

01
Live preview
Component usage.wrn
<BackToTop
  alwaysVisible="true"
/>
Compact

Pill control with label

Show a visible text label when the action needs extra clarity.

02
Live preview
Component usage.wrn
<BackToTop
  showLabel="true"
  alwaysVisible="true"
  variant="soft"
  shape="pill"
/>
Advanced

Progress-aware control

Display page scroll progress around the floating control on long articles or directories.

03
Live preview
Component usage.wrn
<BackToTop
  position="left"
  offset="lg"
  showProgress="true"
  alwaysVisible="true"
  variant="outline"
/>
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
thresholdnumber500No
labelstring"Back to top"No
ariaLabelstring"Scroll back to top"No
iconstring"icon-[lucide--arrow-up]"No
positionstring"right"No
offsetstring"md"No
behaviorstring"smooth"No
showProgressbooleanfalseNo
showLabelbooleanfalseNo
alwaysVisiblebooleanfalseNo
sizestring"default"No
colorstring"primary"No
variantstring"solid"No
shapestring"round"No
classstring""No
} }