Skip to content

Component

Easy — everyone uses thisFrontend

ELI5 — The Vibe Check

A component is a self-contained LEGO brick for your UI. It's a chunk of HTML, CSS, and JavaScript bundled together that you can drop anywhere and reuse as many times as you want. Build once, use everywhere, fix in one place.

Real Talk

A component is a reusable, encapsulated unit of UI that manages its own template, logic, and styles. Modern frameworks like React, Vue, Angular, and Svelte are all component-based. Components accept inputs (props), manage internal state, and emit events.

Show Me The Code

<!-- Vue component -->
<template>
  <button @click="count++">Clicked {{ count }} times</button>
</template>

<script setup>
const count = ref(0);
</script>

When You'll Hear This

"Extract that into a component so we can reuse it in three places." / "The Button component needs a size prop."

Made with passive-aggressive love by manoga.digital. Powered by Claude.