Answer
A component is a reusable piece of the user interface, combining a TypeScript class that holds data and logic, an HTML template that describes what appears on screen, and optionally its own CSS styles. Together these three pieces define one self contained building block of your app.
@Component({
selector: 'app-greeting',
template: `<h1>Hello, {{ name }}</h1>`,
styles: [`h1 { color: blue; }`]
})
export class GreetingComponent {
name = 'Sarah';
}Real-world example A shopping site builds a single ProductCard component and reuses it dozens of times across the homepage, each time simply passing in different product details.