// Generated by scripts/generate-showcase.mjs. Do not edit directly. page BackToTopDetail { layout = "showcase" state playground_threshold = 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") ?? "Back To Top 1 example" state playground_icon = ctx.url.searchParams.get("pg_icon") ?? "" 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") ?? "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_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1" seo { title = "Back To Top" description = "Accessible scroll-to-top control with visibility threshold." } view {
Navigation component

Back To Top

Accessible scroll-to-top control with visibility threshold.

12 props0 slots0 eventsTheme readyResponsive
Interactive playground

Configure Back To Top

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

Live preview
Component code
<BackToTop
  label="Back To Top"
  ariaLabel="Back To Top 1 example"
  showProgress="true"
/>
Component props12 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Production default

Balanced spacing, hierarchy, and content for the most common product workflow.

01
Live preview
Component usage.wrn
<BackToTop
  label="Back To Top"
  ariaLabel="Back To Top 1 example"
  showProgress="true"
/>
Dense UI

Compact application

A tighter variation for dashboards, side panels, tables, and operational interfaces.

02
Live preview
Component usage.wrn
<BackToTop
  label="Compact example"
  ariaLabel="Back To Top 2 example"
  icon="icon-[lucide--arrow-right]"
  showProgress="true"
  size="sm"
  variant="secondary"
/>
Extended

Rich configuration

A more expressive variation using additional data, stronger emphasis, and optional states.

03
Live preview
Component usage.wrn
<BackToTop
  label="Advanced example"
  ariaLabel="Back To Top 3 example"
  icon="icon-[lucide--trash-2]"
  showProgress="true"
  size="lg"
  variant="success"
/>
Component events

Events

Public events declared by this component. Custom events bubble from the component root and expose state through event.detail.

No public component events.
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
sizestring"default"No
colorstring"primary"No
variantstring"solid"No
classstring""No
} }