Skip to content
Statix Design System

Patterns · Marketing

Action dock

A floating pill at the bottom of the screen that keeps the main actions in reach. The customer area uses it on a website page, marketing pages after the hero.

import { ActionDock } from '@statix/ui/action-dock';

Examples

Website actions

Ghost buttons for the common tasks on a website, ending in a dark call button. position="static" keeps it in the flow here; on a page leave the default fixed.

<script lang="ts">
	import { ActionDock } from '@statix/ui/action-dock';
	import { Button } from '@statix/ui/button';
	import RotateCcwIcon from '@lucide/svelte/icons/rotate-ccw';
	import PencilIcon from '@lucide/svelte/icons/pencil';
	import MailIcon from '@lucide/svelte/icons/mail';
	import GlobeIcon from '@lucide/svelte/icons/globe';
	import ShieldCheckIcon from '@lucide/svelte/icons/shield-check';
	import PhoneIcon from '@lucide/svelte/icons/phone';
</script>

<div class="px-4 py-12">
	<ActionDock position="static" label="Website actions">
		<Button href="#restore" variant="ghost"
			><RotateCcwIcon data-icon="inline-start" />Restore</Button
		>
		<Button href="#edit" variant="ghost"><PencilIcon data-icon="inline-start" />Edit</Button>
		<Button href="#mailboxes" variant="ghost"><MailIcon data-icon="inline-start" />Mailboxes</Button
		>
		<Button href="#domain" variant="ghost"><GlobeIcon data-icon="inline-start" />Domain</Button>
		<Button href="#malware" variant="ghost">
			<ShieldCheckIcon data-icon="inline-start" />Malware scan
		</Button>
		<Button href="tel:+4940468970790" variant="dark">
			<PhoneIcon data-icon="inline-start" />Call Jonas
		</Button>
	</ActionDock>
</div>

Marketing

Call, book a call, choose a plan. One primary button at most.

<script lang="ts">
	import { ActionDock } from '@statix/ui/action-dock';
	import { Button } from '@statix/ui/button';
	import PhoneIcon from '@lucide/svelte/icons/phone';
</script>

<ActionDock position="static">
	<Button href="tel:+4940468970790" variant="outline" size="icon" aria-label="Call 040 468 970 790">
		<PhoneIcon />
	</Button>
	<Button href="#contact" variant="outline">Book a call</Button>
	<Button href="#pricing">Choose plan</Button>
</ActionDock>

Show and hide

visible slides the dock out and makes it inert, so hidden buttons can’t take focus.

<script lang="ts">
	import { ActionDock } from '@statix/ui/action-dock';
	import { Button } from '@statix/ui/button';
	import PhoneIcon from '@lucide/svelte/icons/phone';

	let visible = $state(true);
</script>

<div class="flex w-full flex-col items-center gap-6">
	<Button variant="secondary" size="sm" onclick={() => (visible = !visible)}>
		{visible ? 'Hide dock' : 'Show dock'}
	</Button>
	<ActionDock position="static" {visible}>
		<Button
			href="tel:+4940468970790"
			variant="outline"
			size="icon"
			aria-label="Call 040 468 970 790"
		>
			<PhoneIcon />
		</Button>
		<Button href="#contact" variant="outline">Book a call</Button>
		<Button href="#pricing">Choose plan</Button>
	</ActionDock>
</div>

Appear after the hero

Watch a sentinel with IntersectionObserver and show the dock once it leaves the viewport. Scroll inside the box.

Managed WordPress hosting

Scroll down. The dock appears once this hero is gone.

Weekly updates, tested on a copy before they reach your website.

Daily backups with 30 versions, stored in a second data centre.

A fixed contact person who knows your website.

Servers in Frankfurt am Main and Falkenstein.

Monthly cancellation and a 30-day money-back guarantee.

We move your existing website for free.

<script lang="ts">
	import { ActionDock } from '@statix/ui/action-dock';
	import { Button } from '@statix/ui/button';

	let scroller: HTMLDivElement | undefined = $state();
	let hero: HTMLDivElement | undefined = $state();
	let pastHero = $state(false);

	$effect(() => {
		if (!hero) return;
		// On a real page drop `root` to observe the viewport, and use position="fixed".
		const observer = new IntersectionObserver(([entry]) => (pastHero = !entry.isIntersecting), {
			root: scroller
		});
		observer.observe(hero);
		return () => observer.disconnect();
	});
</script>

<div bind:this={scroller} class="h-80 w-full max-w-[560px] overflow-y-auto rounded-lg bg-card">
	<div bind:this={hero} class="bg-tone-navy px-6 py-12 text-white">
		<p class="text-title">Managed WordPress hosting</p>
		<p class="mt-2 text-body text-white/75">
			Scroll down. The dock appears once this hero is gone.
		</p>
	</div>
	<div class="flex flex-col gap-4 px-6 py-8 text-body text-ink-2">
		<p>Weekly updates, tested on a copy before they reach your website.</p>
		<p>Daily backups with 30 versions, stored in a second data centre.</p>
		<p>A fixed contact person who knows your website.</p>
		<p>Servers in Frankfurt am Main and Falkenstein.</p>
		<p>Monthly cancellation and a 30-day money-back guarantee.</p>
		<p>We move your existing website for free.</p>
	</div>
	<ActionDock position="static" visible={pastHero} wrapperClass="sticky bottom-4 pb-1">
		<Button href="#contact" variant="outline" size="sm">Book a call</Button>
		<Button href="#pricing" size="sm">Choose plan</Button>
	</ActionDock>
</div>

Guidelines

Do

  • On marketing pages, show the dock only after the hero, where the same buttons are already visible.
  • Hide it over the footer and on pages that are themselves the destination, such as the contact page.
  • End with the strongest action. In the customer area that is calling the contact person.

Don't

  • Don’t add more than six actions. On phones, hide the labels or drop the least used ones.
  • Don’t drive it from scroll events. Use IntersectionObserver.

Accessibility

  • The dock is a role="group" named "Quick actions". Change the name with label.
  • A hidden dock gets inert, which removes it from the tab order and the accessibility tree.
  • Icon-only buttons inside need an aria-label, for example "Call 040 468 970 790".
  • Reduced motion turns the slide into an instant change through the global theme rule.

API reference

ActionDock

renders <div role="group"> and accepts its attributes
PropTypeDefault
position 'fixed' | 'static'

fixed floats at the bottom centre of the viewport. static stays in the flow.

'fixed'
visible boolean

Hidden docks slide down, fade out and become inert.

true
label string

Accessible name of the group.

'Quick actions'
wrapperClass ClassValue

Classes for the outer positioning wrapper.

–
ref bindHTMLDivElement | null

The dock element.

–
class ClassValue

Merged with the dock classes; yours win.

–
Data attributeMeaning
data-slot="action-dock"The pill.
data-slot="action-dock-wrapper"The positioning wrapper.
data-stateOn the wrapper: "visible" or "hidden".

actionDockVariants

The tailwind-variants function (slots wrapper and dock).