chanan / BlazorStrap

Bootstrap 4 Components for Blazor Framework
https://blazorstrap.io
The Unlicense
910 stars 156 forks source link

How to set class on container div for BSInputSwitch #585

Closed LockTar closed 1 year ago

LockTar commented 1 year ago

Hi,

I want to have the following result in html:

<div class="form-check form-switch form-check-custom form-check-solid">
    <input class="form-check-input" type="checkbox" id="flexSwitchDefault" />
    <label class="form-check-label" for="flexSwitchDefault">
        Default switch
    </label>
</div>

If I use the switch component like this:

<BSInputSwitch CheckedValue="true" UnCheckedValue="false" @bind-Value="model.Enabled">Enabled</BSInputSwitch>

the output will be:

<div class="form-check form-switch">
    <input type="checkbox" class="form-check-input" id="d780baa7152045049afc7afbdecda61f">
    <label class="form-check-label" for="d780baa7152045049afc7afbdecda61f">Enabled</label>
</div>

How can I add CSS classes to the div container? I would like to set the missing form-check-custom form-check-solid.

jbomhold3 commented 1 year ago

5.1.102.51723 released with your changes. Give nuget a moment to list

LockTar commented 1 year ago

Works great! Thank you for your quick response!

LockTar commented 1 year ago

@jbomhold3 Don't forget to release the docs. I updated that as well in the PR. Thanks