Back to articles
Stop Adding Components for Everything — Try This Instead (Vue)

Stop Adding Components for Everything — Try This Instead (Vue)

via Dev.tobUxEE

Most Vue libraries solve problems with more components. Need a loader? → add a component Need selection? → wrap everything Need scroll tracking? → install a plugin + wire state After a while, your UI becomes a tree of wrappers and glue code. 💡 What if behavior didn’t need components? I’ve been experimenting with a different approach: 👉 using directives as a behavior layer Instead of adding structure, you attach behavior directly to elements. ⚡ Example No wrappers. No extra components. No layout changes. 🧠 Why directives? Directives: work at the DOM level don’t affect component structure are composable by nature integrate with any UI library They’re perfect for: 👉 UI behavior 🔥 What I built: Dirigo I started building a small library around this idea: 👉 https://dirigo.woptima.com It’s a collection of advanced Vue directives focused on real-world UX. ✨ Some examples Skeleton loader (no wrapper) Drag-to-select (like desktop) Scroll spy (that actually feels right) Most scroll-spy implementa

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles