In Magento 2, you can achieve this by using the same system.xml file placed under app/code/Vendor
/Package
/etc/adminhtml/system.xml
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="custom_module" translate="label" sortOrder="10">
<label>Progos</label>
</tab>
<section id="custom_module_section" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Custom Module</label>
<tab>custom_module</tab>
<resource>Progos_Custom::custom_config</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>API Settings</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Module Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="api" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>API</label>
<comment>This is comment for this field.</comment>
</field>
<field id="secret" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Secret Key</label>
<comment>This is comment for this field.</comment>
</field>
</group>
</section>
</system> </config>
Please have a look at attached image too.
If you still have any confusion, let us know!
Good Luck!