I want to create a custom dashlet but I don't know how to do that.Please guide me to build a new dashlet. Any github reference or any source. Thanks in advance.
civix generate:page. Optionally assign some smarty variables in run() in the autogenerated php class and edit the autogenerated .tpl with your html.
Then you need to insert an entry in civicrm_dashboard that links the url you chose in generate:page. See the function addGettingStartedDashlet() in CRM/Upgrade/Incremental/php/FourSeven.php, just note the columns have changed slightly if you're on a later version.
Here is an example dashlet with a search: https://github.com/CiviCooP/org.civicoop.quicksearchdashlet