sticky-and-fixed-elements

Solid

Sticky and fixed positioning keeps critical UI persistent as the user scrolls — headers at the top, toolbars at the bottom on mobile. Use deliberately: too many fixed layers create visual noise and reduce content area. Use when designing navigation headers, bottom toolbars, floating action buttons, or table column headers.

AI & Automation 54 stars 9 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
58
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Sticky and Fixed Elements ## position: fixed vs position: sticky | Property | Behaviour | Use for | |---|---|---| | `position: fixed` | Removed from document flow. Always stays at the same viewport position regardless of scroll or parent. | Global navigation header, bottom toolbar, floating action button | | `position: sticky` | Stays in document flow until it hits its scroll threshold, then locks in place. Returns to flow when parent scrolls past. | Table column headers, section headings in a long list, in-page toolbars within a scroll container | **Prefer `sticky` over `fixed`** when the element belongs to a specific section or scroll context. Fixed elements sit above everything and affect the entire viewport — use them only for truly global UI. ## Top — Navigation Header The global navigation header is the most common fixed element. It should: - Remain visible at all times so the user can always navigate away - Be as thin as possible to maximise content area — 48–64px is a common range - Have a background and shadow so content scrolling beneath it does not bleed through - On scroll, a subtle shadow (`--shadow-sm`) signals that content is behind it ```css .site-header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); background: var(--color-surface); box-shadow: var(--shadow-sm); z-index: var(--z-header); } ``` Compensate for the fixed header with matching top padding on the page body: ```css body { padding-top: var(--head...

Details

Author
dembrandt
Repository
dembrandt/dembrandt-skills
Created
4 months ago
Last Updated
yesterday
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Web & Frontend Listed

scroll-cinema

Build scroll-driven "scroll-cinema" websites where scrolling scrubs a camera path instead of translating a document — pinned full-viewport stages, aperture/iris opens, continuous dolly moves, 3D card entries, stacked panels that dim as the next slides over, parallax copy, and masked staggered text reveals. Pure vanilla JS + CSS custom properties, no GSAP/ScrollTrigger/Lenis/Locomotive/Framer. Use this whenever someone wants a "premium agency site", a cinematic or immersive landing page, a scroll-triggered or scroll-scrubbed animation, a pinned/sticky section that animates as you scroll, a hero that transforms on scroll, an Awwwards-style or "expensive-looking" site, a scrollytelling piece, or references a site/reel whose scrolling animation they want reproduced. Also use it when someone asks whether a particular scroll animation is buildable, or wants an existing scroll effect debugged (janky scrubbing, sticky not sticking, animation stuck at its start state).

1 Updated 1 months ago
Dhyey2907
Web & Frontend Listed

creative-ui

Turns a brief into an interface that looks designed rather than generated: real layout craft, a considered type and colour system, and motion that means something. Picks its own approach from the request, sources what already exists instead of rebuilding it, holds an accessibility and performance floor, and verifies the result before reporting. Use for landing pages, portfolios, product pages, marketing sites and redesigns — and for "make this look premium", "this looks like a template", "make it feel expensive", "award quality", "animate this page", "smooth scroll", "parallax", "pinned section", "horizontal scroll", "scroll animation", "scrollytelling", "text reveal", "page transition", "3D hero", "make the landing page move", or any request where an interface has to look and move like someone with taste built it.

0 Updated 2 weeks ago
ansh2807
Web & Frontend Listed

make-interfaces-feel-better

Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, typography, micro-interactions, enter/exit animations, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, font smoothing, tabular numbers, image outlines, box shadows.

3 Updated yesterday
arthjean