{"id":2249,"date":"2016-12-29T06:48:13","date_gmt":"2016-12-29T06:48:13","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/salesforce\/?p=2249"},"modified":"2025-06-10T10:39:50","modified_gmt":"2025-06-10T10:39:50","slug":"creating-a-lightning-component","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/12\/29\/creating-a-lightning-component\/","title":{"rendered":"Creating a Lightning Component"},"content":{"rendered":"<p>Lightning Components are the self-contained and reusable units of an app. They represent a reusable section of the UI. It is a bundle that can contain other components, as well as HTML, CSS, JavaScript, or any other Web-enabled code. This enables you to build apps with sophisticated UI&#8217;s. It can range in granularity from a single line of text to an entire app.<\/p>\n<p>Let&#8217;s start creating a Lightning Component in Salesforce. Please find below screenshots for the Steps to create the Lightning Component:<\/p>\n<p>-&gt; The first step to create the Lightning Components is, getting set up to write the code, which is very easy in &#8216;Developer Edition&#8217; org. Just go to the &#8216;Settings&#8217; menu, and click on &#8216;Developer Console&#8217;.<\/p>\n<div id=\"attachment_2256\" style=\"width: 605px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image1-Opening-developer-console.jpg\" target=\"_blank\" rel=\"noopener\"><img fetchpriority=\"high\" decoding=\"async\" aria-describedby=\"caption-attachment-2256\" class=\"size-large wp-image-2256\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image1-Opening-developer-console-1024x489.jpg\" alt=\"Opening developer console\" width=\"595\" height=\"284\" \/><\/a><p id=\"caption-attachment-2256\" class=\"wp-caption-text\">Opening developer console<\/p><\/div>\n<p>-&gt; Create Lightning Components in the Developer Console :Select &#8216;File&#8217; &#8211; &#8216;New&#8217; &#8211; &#8216;Lightning Component&#8217; to create a new Lightning component.<\/p>\n<div id=\"attachment_2257\" style=\"width: 714px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image2-Creating-new-lightning-component.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" aria-describedby=\"caption-attachment-2257\" class=\"size-full wp-image-2257\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image2-Creating-new-lightning-component.jpg\" alt=\"Creating new lightning component\" width=\"704\" height=\"478\" \/><\/a><p id=\"caption-attachment-2257\" class=\"wp-caption-text\">Creating new lightning component<\/p><\/div>\n<p>-&gt; In the New Lightning Bundle panel, enter &#8216;HelloWorld&#8217; for the component name, and click Submit.<\/p>\n<div id=\"attachment_2250\" style=\"width: 559px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image3-Naming-lightning-component.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" aria-describedby=\"caption-attachment-2250\" class=\"size-full wp-image-2250\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image3-Naming-lightning-component.jpg\" alt=\"Naming lightning component\" width=\"549\" height=\"428\" \/><\/a><p id=\"caption-attachment-2250\" class=\"wp-caption-text\">Naming lightning component<\/p><\/div>\n<p>-&gt; This creates a new &#8216;HelloWorld&#8217; component bundle, with two open tabs. Close the &#8216;HelloWorld&#8217; tab, and keep the &#8216;HelloWorld.cmp&#8217; tab open.&#8217;HelloWorld.cmp&#8217; contains the opening and closing tags for a Lightning component,. Between them, add the following markup, and save:<\/p>\n<div id=\"attachment_2251\" style=\"width: 605px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image4-Code-of-HelloWorld-lightning-component.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2251\" class=\"size-large wp-image-2251\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image4-Code-of-HelloWorld-lightning-component-1024x534.jpg\" alt=\"Code of 'HelloWorld' lightning component\" width=\"595\" height=\"310\" \/><\/a><p id=\"caption-attachment-2251\" class=\"wp-caption-text\">Code of &#8216;HelloWorld&#8217; lightning component<\/p><\/div>\n<p>-&gt; Create Lightning App in the Developer Console :Select &#8216;File&#8217; &#8211; &#8216;New&#8217; &#8211; &#8216;Lightning Application&#8217; to create a new Lightning app.<\/p>\n<div id=\"attachment_2252\" style=\"width: 876px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image5-Creating-new-lightning-app.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2252\" class=\"size-full wp-image-2252\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image5-Creating-new-lightning-app.jpg\" alt=\"Creating new lightning app\" width=\"866\" height=\"437\" \/><\/a><p id=\"caption-attachment-2252\" class=\"wp-caption-text\">Creating new lightning app<\/p><\/div>\n<p>-&gt; In the New Lightning Bundle panel, enter &#8216;HelloWorldApp&#8217; for the app name, and click Submit.<\/p>\n<div id=\"attachment_2253\" style=\"width: 541px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image6-Naming-lightning-app.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2253\" class=\"size-full wp-image-2253\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image6-Naming-lightning-app.jpg\" alt=\"Naming lightning app\" width=\"531\" height=\"418\" \/><\/a><p id=\"caption-attachment-2253\" class=\"wp-caption-text\">Naming lightning app<\/p><\/div>\n<p>-&gt; This creates a new &#8216;HelloWorldApp&#8217; bundle, with two open tabs. Close the &#8216;HelloWorldApp&#8217; tab, and keep the &#8216;HelloWorldApp.app&#8217; tab open. &#8216;HelloWorldApp.app&#8217; contains the opening and closing tags for a Lightning app,. Between them, add the following markup, and save:<\/p>\n<div id=\"attachment_2254\" style=\"width: 605px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image7-Code-of-HelloWorld-lightning-app.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2254\" class=\"size-large wp-image-2254\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image7-Code-of-HelloWorld-lightning-app-1024x553.jpg\" alt=\"Code of 'HelloWorld' lightning app\" width=\"595\" height=\"321\" \/><\/a><p id=\"caption-attachment-2254\" class=\"wp-caption-text\">Code of &#8216;HelloWorld&#8217; lightning app<\/p><\/div>\n<p>This adds the &#8216;HelloWorld&#8217; component we created earlier to the HelloWorldApp.<\/p>\n<p>-&gt; &#8216;HelloWorldApp.app&#8217; file has the Preview button. Apps have &#8216;Preview&#8217; button, components don\u2019t. Click it now, and another browser window opens and shows our app.<\/p>\n<div id=\"attachment_2255\" style=\"width: 676px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image8-Output-of-lightning-component.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2255\" class=\"size-full wp-image-2255\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2016\/12\/Image8-Output-of-lightning-component.jpg\" alt=\"Output of lightning component\" width=\"666\" height=\"198\" \/><\/a><p id=\"caption-attachment-2255\" class=\"wp-caption-text\">Output of lightning component<\/p><\/div>\n<p><strong>References:<\/strong> <a href=\"https:\/\/trailhead.salesforce.com\/lex_dev_lc_basics\/lex_dev_lc_basics_create\" target=\"_blank\" rel=\"noopener\">https:\/\/trailhead.salesforce.com\/lex_dev_lc_basics\/lex_dev_lc_basics_create<\/a><\/p>\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><br \/>\n<a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>\u00a0as a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners across the globe. We offers Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that requires apex code incorporation into the Salesforce platform.<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>\u00a0has some unique solutions for Cloud CRM such as Salesforce integration with\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Sage Enterprise Management (Sage X3<\/a>),\u00a0Sage Intacct, <a href=\"https:\/\/www.greytrix.com\/product\/sage-100-erp\/gumu-100-salesforce-integration\">Sage 100\u00a0<\/a>and\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/gumu-300-salesforce-integration\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/crm-development\/salesforce-com\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/data-migration-services\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/integrated-application-development\">Integrated App development<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/custom-development\">Custom App development<\/a> and <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/maintenance-support\">Technical Support<\/a> to business partners and end users.<\/p>\n<p>Greytrix GUMU&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star app listed on <a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<\/p>\n<p>For more information, please contact us at\u00a0<a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n<p><strong><span style=\"font-size: Medium;\">Related Posts<\/span><\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/11\/30\/gumu-for-salesforce-integration-with-sage-erp\/\">Get GUMU&#x2122; for Salesforce integration with Sage ERP<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/11\/24\/integrate-salesforce-with-sage-300-integration\/\">Leverage real-time enterprise data for better insights of your Customers with Salesforce \u2013 Sage 300 integration<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/11\/21\/real-time-details-in-gumu-sage-300-erp-integration-for-salesforce\/\">Real-time details in GUMU&#x2122; SAGE 300 ERP Integration for Salesforce<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/11\/21\/real-time-details-in-gumu-sage-100-erp-integration-for-salesforce\/\">Real-time details in GUMU&#x2122; SAGE 100 ERP Integration for Salesforce<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Lightning Components are the self-contained and reusable units of an app. They represent a reusable section of the UI. It is a bundle that can contain other components, as well as HTML, CSS, JavaScript, or any other Web-enabled code. This enables you to build apps with sophisticated UI&#8217;s. It can range in granularity from a\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/12\/29\/creating-a-lightning-component\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[206,207,208,212,651],"class_list":["post-2249","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-lightning","tag-lightning-basics","tag-lightning-component","tag-lightning-intro","tag-salesforce-lightning-component"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/2249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=2249"}],"version-history":[{"count":5,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/2249\/revisions"}],"predecessor-version":[{"id":10893,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/2249\/revisions\/10893"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=2249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=2249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=2249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}