JSFiddle - React, Tailwind, and code Playground

HTML

<form action="" class="form-choice" >
    </form>

CSS

.choice{
            display: block;
        }
        .choice:checked ~ span {
            background: #000;
        }

JavaScript

const data = [
            {name: 'Модуль1', id: 23},
            {name: 'Модуль2', id: 45},
            {name: 'Модуль3', id: 32},
            {name: 'Модуль4', id: 56},
            {name: 'Модуль5', id: 67}
        ]

        const form = document.querySelector('.form-choice')

        function addCollection(data) {
            let input = document.createElement('input')
            input.type = 'checkbox'
            input.value = data[0].name
            input.name = 'name'
            form.appendChild(input)
            let label = document.createElement('label')
            
            label.innerHTML = data[0].name
                        
            console.log(input)
            form.appendChild(label)

        }
        addCollection(data)