Learn SALESFORCE-LIGHTNING with Real Code Examples
Updated Nov 26, 2025
Code Sample Descriptions
1
Simple Counter App
# salesforce_lightning/demo/CounterApp
1. Create a Lightning Web Component 'counterApp'
2. Add a variable 'counter' initialized to 0 in JS controller
3. Add a Button element in HTML template
4. Add a Text element to display 'counter'
5. Configure Button click handler -> Increment 'counter'
6. Bind Text element to show current 'counter' value
7. Deploy and preview
A basic Salesforce Lightning example that increments a counter using LWC.
2
Simple To-Do List
# salesforce_lightning/demo/ToDoApp
1. Create LWC 'todoApp'
2. Use Salesforce Object 'Task' with fields 'Title' and 'Completed'
3. Display list of Tasks in HTML template
4. Add Text Input to enter new Task
5. Add Button -> On Click: Create Task record
6. Add Checkbox -> Update 'Completed' status
7. Preview adding and completing tasks
Create a simple To-Do list app using LWC and Salesforce records.
3
Simple Notes App
# salesforce_lightning/demo/NotesApp
1. Create LWC 'notesApp'
2. Use Salesforce Object 'Note' with fields 'Title' and 'Content'
3. Display list of Notes in template
4. Add Button -> Action: Create Note
5. Add Edit functionality -> Update Note
6. Add Delete Button -> Delete Note
7. Preview note management
Create, edit, and delete notes using Salesforce records and LWC.
4
Simple Login Screen
# salesforce_lightning/demo/LoginScreen
1. Create LWC 'loginScreen'
2. Add Text Inputs for Email and Password
3. Add Login Button -> Action: Validate User
4. Show error messages
5. Redirect on successful login
6. Preview login flow
Login screen using Salesforce LWC and Users object.
5
Simple Sign-Up Form
# salesforce_lightning/demo/SignUpForm
1. Create LWC 'signUpForm'
2. Add Text Inputs for Email, Password, Name
3. Add Button -> Action: Create User
4. Show success message
5. Redirect to Home Page
6. Preview sign-up
Create new users with LWC and Salesforce Users object.
6
Simple Profile Page
# salesforce_lightning/demo/ProfilePage
1. Create LWC 'profilePage'
2. Display current user fields (Name, Email, Avatar)
3. Add Edit Button -> Update fields
4. Preview profile page
Display and edit user profile using LWC.
7
Simple Shopping List
# salesforce_lightning/demo/ShoppingList
1. Create LWC 'shoppingList'
2. Use Object 'Items' with fields 'Name', 'Quantity'
3. Display list of Items
4. Add Button -> Create Item
5. Add Input -> Update Quantity
6. Add Delete Button -> Delete Item
7. Preview shopping list
Create a shopping list with Salesforce objects and LWC.
8
Simple Event RSVP App
# salesforce_lightning/demo/EventRSVP
1. Create LWC 'eventRSVP'
2. Use Object 'Event' with fields 'Title', 'Date', 'Attendees'
3. Display list of Events
4. Add Button -> Action: Add current user to Attendees
5. Display number of Attendees
6. Preview RSVP interactions
Allow users to RSVP to events with LWC and Salesforce records.
9
Simple Task Progress Tracker
# salesforce_lightning/demo/TaskTracker
1. Create LWC 'taskTracker'
2. Use Object 'Tasks' with fields 'Title', 'Status'
3. Display list of Tasks
4. Add Dropdown -> Update 'Status'
5. Display progress text
6. Preview task updates
Track task progress using status field in Salesforce records and LWC.
10
Simple Image Gallery
# salesforce_lightning/demo/ImageGallery
1. Create LWC 'imageGallery'
2. Use Object 'Images' with fields 'Title', 'Image'
3. Display list in Grid layout
4. Bind Image component to field 'Image'
5. Preview gallery
Display images in a gallery using LWC and Salesforce records.