Introduction to Properties

Variables in LWC (as you know them in Java, Python, etc.) are called Properties in LWC.

Don’t start a property name with:

And don’t use these reserved words for property names.

There are 3 types of properties in LWC:

Private Properties

It is declared using only an identifier name and don’t need a datatype.

This is a simple example:

<template>
  <lightning-card title="Greeting Message" icon-name="custom:custom14">
    <div class="slds-var-m-around_medium">
      <p>{greetingMessage}</p>
    </div>
  </lightning-card>
</template>