@Input

Declares a class property as a component input bound from the parent.

Since Angular 2+ Spec ↗

Syntax

@Input(options?) propertyName: T

Parameters

NameTypeRequiredDescription
options object No Supports alias, required, and transform.

Returns

PropertyDecorator — Decorator exposing the property as an input binding.

Examples

import { Component, Input } from '@angular/core';

@Component({
  selector: 'app-card',
  standalone: true,
  template: `<h2>{{ title }}</h2>`,
})
export class CardComponent {
  @Input({ required: true }) title!: string;
  @Input() subtitle = '';
}

Notes

The decorator form is the classic API; new signal-based code should prefer input() for reactive reads. Use `{ required: true }` to enforce a binding and `transform` to coerce values (e.g. booleanAttribute). Alias to publish a different binding name.