Dynamic Components
Teaches dynamic component switching with Vue's <component> element. Use when you need to render different components conditionally based on runtime state using the is attribute.
Install
npx skills add PatternsDev/skills --skill dynamic-componentsgit clone --depth 1 https://github.com/PatternsDev/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/vue/dynamic-components ~/.claude/skills/dynamic-componentsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Dynamic Components ## Table of Contents - [When to Use](#when-to-use) - [Instructions](#instructions) - [Details](#details) - [Source](#source) Dynamic components constitute the ability to dynamically change (i.e. switch) between components by binding an `is` attribute to the reserved `<component>` element. We'll go through an example to best understand how dynamic components work. Assume we have separate components titled `Home`, `Feed`, and `History` that simply display text dictating what component it is. ## When to Use - Use this when you need to render different components based on user interaction (e.g., tabs, views) - This is helpful as an alternative to multiple `v-if`/`v-else` blocks for conditional component rendering ## Instructions - Bind the `is` attribute on `<component>` to a reactive value referencing the component definition - Use a `tabs` object mapping names to imported component definitions - Wrap `<component>` with `<KeepAlive>` to preserve state when switching between dynamic components ## Details ```html <template><div class="tab">Home component</div></template> <template><div class="tab">Feed component</div></template> <template><div class="tab">History component</div></template> ``` Our goal is to build an interface that surfaces a list of tabs that can be clicked. Depending on what tab is clicked, we want to dynamically render a certain component.
Details
- Skill name
dynamic-components- Repository
- PatternsDev/skills
- Path
vue/dynamic-components/SKILL.md- Repo updated
- 15 April 2026
FAQ
What does the Dynamic Components skill do?
Teaches dynamic component switching with Vue's <component> element. Use when you need to render different components conditionally based on runtime state using the is attribute.
How do I install the Dynamic Components skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add PatternsDev/skills --skill dynamic-components. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Dynamic Components popular?
It lives in PatternsDev/skills, which has 259 GitHub stars and 28 forks.
Related skills
AI UI Patterns
259PatternsDev/skills
Teaches design patterns for building AI-powered React interfaces. Use when creating chatbots, intelligent assistants, streaming UIs, or any AI-driven user experience in React.
Async Components
259PatternsDev/skills
Teaches async component loading in Vue for performance optimization. Use when you have heavy components that aren't needed on initial render and can be loaded on demand.
Bundle Splitting
259PatternsDev/skills
Teaches bundle splitting techniques for web performance. Use when your application has a large JavaScript bundle that affects load times or when you need to reduce FCP/LCP.
Hoc Pattern
259PatternsDev/skills
Teaches the Higher-Order Component (HOC) pattern for logic reuse. Use when you need to share cross-cutting concerns like authentication, logging, or data fetching across multiple components.
Data Provider
259PatternsDev/skills
Teaches the data provider pattern using renderless components and scoped slots. Use when you need to abstract data fetching or state management logic and expose it to child components via slots.
Hooks Pattern
259PatternsDev/skills
Teaches React Hooks for reusing stateful logic across components. Use when extracting shared behavior like form handling, subscriptions, or side effects into reusable custom hooks.
Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.