Fields, Properties, and Attributes

Declare fields in your component’s JavaScript class. Reference them in your component’s template to dynamically update content.

Field and property are almost interchangeable terms. A component author declares fields in a class. An instance of the class has properties. To component consumers, fields are properties. In a Lightning web component, only fields that a component author decorates with @api are publicly available to consumers as object properties.

Property and attribute are almost interchangeable terms and can be confusing. Generally speaking, in HTML we talk about attributes, and in JavaScript we talk about properties.

If you’ve developed an Aura component, you’re familiar with the term attribute. In a Lightning web component, the closest thing to an Aura attribute is a JavaScript property.