Activity Forums Salesforce® Discussions What are component Naming Rules in Salesforce Lightning?

  • Prachi

    Member
    August 23, 2018 at 12:53 pm

    Hi Avnish,

    A These are Naming Rules in Salesforce Lightning
    • Must begin with a letter
    • Must contain only alphanumeric or underscore characters
    • Must be unique in the namespace
    • Can’t include whitespace
    • Can’t end with an underscore
    • Can’t contain two consecutive underscores

    thanks

  • shariq

    Member
    September 16, 2018 at 3:47 pm

    Hi,

    To add more -

    I prefer using a Application name as prefix and follow the component specification .Lets say my application name is "Chat" .Then i would name my components as below

    "chatcmp.cmp"

    "chatcontroller.js"

    "chatHelper.js"

    "chatevent.evt"

    "chatSVG.SVG"

    Naming convention should be based on component functionality to make it easier to locate the components .

    Hope this helps.

  • Parul

    Member
    September 16, 2018 at 5:43 pm

    Hi

    A component name must follow the naming rules for Lightning components.
    A component name must follow these naming rules:

    Must begin with a letter
    Must contain only alphanumeric or underscore characters
    Can’t end with an underscore
    Can’t contain two consecutive underscores

    Thanks

    • This reply was modified 5 years, 7 months ago by  Parul.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos