Forums

Convert Svelte radio button list to fastHTML

Hi, l'm new to fastHTML, how would I convert the following radio button list from Svelte:

    :::python

<script> const categoryChange = () => { showImage.set(false); textareaContent.set(''); isImageLoaded.set(false); isDisabled = true; isUploadDisabled = true; inputValue = ''; } let isUploaderVisible = false; // Controls visibility of the uploader </script> <div class="radio-buttons"> <label> <input type="radio" name="cat" value="random" checked={$selectedMenuItem === 'random'} bind:group={$selectedMenuItem} onchange={categoryChange}

                />
                Random - selects from any category
            </label>
            {#each ['nature', 'people', 'art & culture', 'music', 'sport'] as category}
                <label>
                    <input
                        type="radio"
                        name="cat"
                        value={category}
                        bind:group={$selectedMenuItem}
                        onchange={categoryChange}

                    />
                    {category}
                </label>
            {/each}
        </div>

Thanks for any help enter code here

We're not really a fasthtml help forum, but perhaps one of our users knows and can help.