Home SALESFORCELightning Web Component List of Case Types with Example in Lightning Web Component – Pascal, Camel, Kebab, Snake and Upper Case

List of Case Types with Example in Lightning Web Component – Pascal, Camel, Kebab, Snake and Upper Case

While create Component Name, Controller Name, Variable Name, Class Name in Lightning Web Component we need to maintain the case types and below are the list of case types with Example.

Case Types Example Where to Use
Pascal Case SfdcLearnShare Its used to create a class name (ItemName)
Camel Case sfdcLearnShare Property names in Javascript are in camel Case (itemName)
Kebab Case sfdc-learn-share HTML attributes are in kebab case and Its used to LWC for component rendering, calling from one component to another component, set value attribute name to other component in LWC (item-name)
Snake Case sfdc_learn_share Its often used as a convention in declaring constants in many languages like C, C++, Java, PHP, Python Languages (item_name)
Upper Case (Snake Case) SFDC_LEARN_SHARE Its often used as a convention in declaring constants in many languages like C, C++, Java, PHP, Python Languages (ITEM_NAME)

Component Folder Structure while creating Lightning Web Component – https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.create_components_folder

JavaScript Property Names while creating Lightning Web Component – https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.js_props_names

Component JavaScript File Structure with Examples – https://developer.salesforce.com/docs/component-library/documentation/lwc/create_components_javascript

 

You may also like

Leave a Comment