This repository provides quick start code samples designed to help you to create the Lead Form. Before you start, see Send Visitor Information to the Salesforce Leads Object to set the appropriate permissions for access to the API and Lead object.
This repository is an SFDX project that you can deploy directly to an org and modify. To deploy the sample Lead Form, follow the documentation here.