el-affix

Fix UI elements to a viewport area with configurable offsets and targets.

21|2|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/jiaiyan/element-plus-skills --skill el-affix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: el-affix
Source: https://github.com/jiaiyan/element-plus-skills/tree/main/components/el-affix
Command: npx skills add https://github.com/jiaiyan/element-plus-skills --skill el-affix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Affix components fix elements to a defined area of the viewport, ensuring critical UI remains accessible during scrolling.

Core Features & Use Cases

  • Sticky positioning for headers, toolbars, and floating actions.
  • Works inside scroll containers and on the page root with configurable offsets.
  • Enables consistent UX when navigation or controls must stay in view during user scroll.

Quick Start

Place an el-affix around a header and set an offset to activate sticky behavior.

Frequently Asked Questions about el-affix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a header sticky during page scroll in vue?

To make a header sticky in vue, wrap it in an affix component to fix the element to a defined viewport area. This ensures critical navigation remains accessible while scrolling the page root.

What is an affix component used for in element-plus?

An affix component in element-plus is used to keep essential UI elements visible by fixing them to a specific viewport area. It is applicable to headers, toolbars, and floating controls during scrolling.

Can I use sticky positioning inside a scroll container with vue?

Yes, sticky positioning works inside scroll containers and on the page root with configurable offsets. This enables consistent UX when navigation or controls must stay in view during vertical scrolling.

Does the element-plus affix support z-index and offset configuration?

Yes, the element-plus affix satisfies attribute handling for offset, position, target, z-index, teleported, and append-to. These settings allow precise control over sticky behavior and visual layering.