📖 Step 3: Design - UI Components & Patterns#80 / 291

Z-Index

Z-Index

📖One-line summary

The stacking order of elements — higher numbers sit on top.

Example

z-index controls stacking order

z-10
z-20
z-30

Vibe coding prompt examples

>_

Organize the project's z-index system. Build CSS variables for layer order: dropdown(10), sticky(20), modal(30), toast(40), tooltip(50).

>_

Resolve a z-index conflict. There is a bug where the dropdown is hidden behind the modal. Analyze the stacking context and fix it.

>_

Build a utility for managing z-index. Build a helper function and Tailwind plugin that returns a z-index value by layer name.

Try these prompts in your AI coding assistant!