Composition API versus the older Options API
Vue 2 organized components around an Options API, grouping code by type (data, computed, methods) rather than by feature. Vue 3's Composition API groups code by what it does, so all the logic for one feature (a search filter, a form's validation) can live together in one composable function regardless of whether it touches state, computed values or lifecycle hooks.
We write new Vue projects entirely in the Composition API with `<script setup>` syntax, which removes most of the remaining boilerplate. Projects still on Vue 2 or the Options API can adopt the Composition API incrementally, component by component, since Vue 3 supports both styles in the same codebase during a migration.








