Skip to content

sivanirina/dynamic-nav-button-lwc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Navigation Button (LWC)

A reusable Lightning Web Component that renders a configurable button and navigates users to different destinations in Salesforce.

🚀 Features

  • Navigate to custom or standard tabs
  • Open object home pages or list views
  • Open specific Reports
  • Open specific Dashboards
  • Optional icon support
  • Admin-friendly configuration via Lightning App Builder

📦 Supported Navigation Types

Type Description
tab Custom or standard navigation tab
object Object home or list view
report Specific report
dashboard Specific dashboard

⚙️ Configuration (Lightning App Builder)

Common Properties

  • Button Label – Text shown on the button
  • Icon Name (optional) – SLDS icon name (e.g. utility:chart)
  • Navigation Typetab, object, report, dashboard

Tab Navigation

  • Target Tab API Name – API name of the tab

Object Navigation

  • Object API Name – e.g. Account
  • List View Developer Name (optional) – e.g. My_Open_Opportunities

Report / Dashboard Navigation

  • Target Record Id
    • Report Id starts with 00O
    • Dashboard Id starts with 01Z

🧠 Notes

  • List view navigation uses DeveloperName, not Id
  • Report and dashboard navigation uses Lightning URLs
  • User permissions are respected automatically

🛠️ Installation

Prerequisites

  • Salesforce CLI (sf) installed
  • An authenticated Salesforce org

Authenticate to an Org

sf org login web

Deploy using Salesforce DX:

sf project deploy start --source-dir force-app/main/default/lwc/dynamicNavButton

📘 This project accompanies the blog post
How I Replaced Cluttered Tabs with a Single Dynamic Button in Salesforce

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors