$form['name'] = [
'#type' => 'textfield',
'#title' => $this->t('Name'),
'#wrapper_attributes' => [
'class' => [
'wrapper-class',
],
],
];
This creates the following HTML.
<div class="wrapper-class">
<label for="edit-name">Name</label>
<input class="form-text" type="text" id="edit-name" name="name" value="test">
</div>
Add new comment