Images as label for checkbox and radio button


Topic: Images as label for checkbox and radio button

AB pro premium asked a year ago

I am looking to use images as label for checkbox and radio button in MDB React.

Can you help me with that or direct me to the relevant documentation?


Jakub Chmura staff premium answered a year ago

Hi @AB,

To set image as a label please use label like this:

          <MDBInput
            value='Classic checkbox'
            label={
              <img
                src='https://via.placeholder.com/150x30'
                className='img-fluid'
                alt='tst'
              />
            }
            type='checkbox'
            id='checkbox'
          />

Best, Kuba


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: React
  • MDB Version: 4.24.0
  • Device: macbook air
  • Browser: firefox
  • OS: mac os
  • Provided sample code: No
  • Provided link: No