Skip to main content

Custom Inputs

Here are the examples of custom inputs made with the help of MUI's Radio and Checkbox. Please refer to our docs for more details.

Custom Horizontal Radios

Basic

Free

Get 1 project with 1 team member.

Premium

$5.00

Get 5 projects with 5 team members.


// React Imports
import { ChangeEvent, useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Type Import
import { CustomInputHorizontalData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputHorizontal from '@core/components/custom-inputs/Horizontal'

const data: CustomInputHorizontalData[] = [
{
meta: 'Free',
title: 'Basic',
value: 'basic',
isSelected: true,
content: 'Get 1 project with 1 team member.'
},
{
meta: '$5.00',
title: 'Premium',
value: 'premium',
content: 'Get 5 projects with 5 team members.'
}
]

const CustomHorizontalRadio = () => {
const initialSelected: string = data.filter(item => item.isSelected)[data.filter(item => item.isSelected).length - 1]
.value

// States
const [selected, setSelected] = useState<string>(initialSelected)

const handleChange = (prop: string | ChangeEvent<HTMLInputElement>) => {
if (typeof prop === 'string') {
setSelected(prop)
} else {
setSelected((prop.target as HTMLInputElement).value)
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => (
<CustomInputHorizontal
type='radio'
key={index}
data={item}
selected={selected}
name='custom-radios-basic'
handleChange={handleChange}
gridProps={{ sm: 6, xs: 12 }}
/>
))}
</Grid>
)
}

export default CustomHorizontalRadio
Custom Horizontal Checkboxes

Discount

20%

Wow! Get 20% off on your next purchase!

Updates

Free

Get Updates regarding related products.


// React Imports
import { useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Type Imports
import type { CustomInputHorizontalData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputHorizontal from '@core/components/custom-inputs/Horizontal'

const data: CustomInputHorizontalData[] = [
{
meta: '20%',
isSelected: true,
value: 'discount',
title: 'Discount',
content: 'Wow! Get 20% off on your next purchase!'
},
{
meta: 'Free',
value: 'updates',
title: 'Updates',
content: 'Get Updates regarding related products.'
}
]

const CustomHorizontalCheckbox = () => {
const initialSelected: string[] = data.filter(item => item.isSelected).map(item => item.value)

// States
const [selected, setSelected] = useState<string[]>(initialSelected)

const handleChange = (value: string) => {
if (selected.includes(value)) {
const updatedArr = selected.filter(item => item !== value)
setSelected(updatedArr)
} else {
setSelected([...selected, value])
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => (
<CustomInputHorizontal
type='checkbox'
key={index}
data={item}
selected={selected}
handleChange={handleChange}
name='custom-checkbox-basic'
gridProps={{ sm: 6, xs: 12 }}
/>
))}
</Grid>
)
}

export default CustomHorizontalCheckbox
Custom Vertical Radios With Icon

Starter

A simple start for everyone.

Standard

For small to medium businesses.

Enterprise

Solution for big organizations.


// React Imports
import { ChangeEvent, useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Third-party Imports
import classnames from 'classnames'

// Type Import
import { CustomInputVerticalData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputVertical from '@core/components/custom-inputs/Vertical'

const data: CustomInputVerticalData[] = [
{
value: 'starter',
title: 'Starter',
isSelected: true,
content: 'A simple start for everyone.',
asset: 'ri-rocket-line'
},
{
value: 'standard',
title: 'Standard',
content: 'For small to medium businesses.',
asset: 'ri-user-3-line'
},
{
value: 'enterprise',
title: 'Enterprise',
content: 'Solution for big organizations.',
asset: 'ri-vip-crown-line'
}
]

const CustomVerticalRadioIcon = () => {
const initialSelected: string = data.filter(item => item.isSelected)[data.filter(item => item.isSelected).length - 1]
.value

// States
const [selected, setSelected] = useState<string>(initialSelected)

const handleChange = (prop: string | ChangeEvent<HTMLInputElement>) => {
if (typeof prop === 'string') {
setSelected(prop)
} else {
setSelected((prop.target as HTMLInputElement).value)
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => {
let asset

if (item.asset && typeof item.asset === 'string') {
asset = <i className={classnames(item.asset, 'text-[28px]')} />
}

return (
<CustomInputVertical
type='radio'
key={index}
data={{ ...item, asset }}
selected={selected}
name='custom-radios-icons'
handleChange={handleChange}
gridProps={{ sm: 4, xs: 12 }}
/>
)
})}
</Grid>
)
}

export default CustomVerticalRadioIcon
Custom Vertical Checkboxes With Icon

Backup

Backup every file from your project.

Encrypt

Translate your data to encrypted text.

Site Lock

Security tool to protect your website.


// React Imports
import { useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Third-party Imports
import classnames from 'classnames'

// Type Imports
import { CustomInputVerticalData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputVertical from '@core/components/custom-inputs/Vertical'

const data: CustomInputVerticalData[] = [
{
value: 'backup',
title: 'Backup',
isSelected: true,
content: 'Backup every file from your project.',
asset: 'ri-server-line'
},
{
value: 'encrypt',
title: 'Encrypt',
content: 'Translate your data to encrypted text.',
asset: 'ri-shield-line'
},
{
value: 'site-lock',
title: 'Site Lock',
content: 'Security tool to protect your website.',
asset: 'ri-lock-2-line'
}
]

const CustomVerticalCheckboxIcon = () => {
const initialSelected: string[] = data.filter(item => item.isSelected).map(item => item.value)

// States
const [selected, setSelected] = useState<string[]>(initialSelected)

const handleChange = (value: string) => {
if (selected.includes(value)) {
const updatedArr = selected.filter(item => item !== value)
setSelected(updatedArr)
} else {
setSelected([...selected, value])
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => {
let asset

if (item.asset && typeof item.asset === 'string') {
asset = <i className={classnames(item.asset, 'text-[28px]')} />
}

return (
<CustomInputVertical
type='checkbox'
key={index}
selected={selected}
data={{ ...item, asset }}
handleChange={handleChange}
name='custom-checkbox-icons'
gridProps={{ sm: 4, xs: 12 }}
/>
)
})}
</Grid>
)
}

export default CustomVerticalCheckboxIcon
Custom Vertical Radio With SVG

Starter

A simple start for everyone.

Standard

For small to medium businesses.

Enterprise

Solution for big organizations.


// React Imports
import { ChangeEvent, useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Type Import
import { CustomInputVerticalData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputVertical from '@core/components/custom-inputs/Vertical'

type Data = Omit<CustomInputVerticalData, 'asset'>

const data: Data[] = [
{
value: 'starter',
title: 'Starter',
isSelected: true,
content: 'A simple start for everyone.'
},
{
value: 'standard',
title: 'Standard',
content: 'For small to medium businesses.'
},
{
value: 'enterprise',
title: 'Enterprise',
content: 'Solution for big organizations.'
}
]

const SVGs = [
{
asset: (
<svg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M0 6C0 2.68629 2.68629 0 6 0H34C37.3137 0 40 2.68629 40 6V34C40 37.3137 37.3137 40 34 40H6C2.68629 40 0 37.3137 0 34V6Z'
fill='#FF4C51'
fill-opacity='0.16'
/>
<path
d='M16.8617 27.9399C16.7846 28.4256 16.3658 28.7831 15.8741 28.7831H12.0423C11.1956 28.7849 10.5077 28.1 10.5059 27.2533C10.5057 27.1677 10.5127 27.0823 10.5267 26.998L13.1166 10.5917C13.2638 9.67626 14.0526 9.00235 14.9798 8.99988H21.1937C23.7542 8.99988 25.6019 9.62 26.6859 10.8426C27.7325 12.0485 28.1346 13.6845 27.766 15.2382C27.7445 15.3729 27.723 15.5087 27.6908 15.6562C26.8675 19.8739 24.0355 22.1132 19.5052 22.1132H17.7865L16.8617 27.9399Z'
fill='#FFA2A5'
/>
<path
d='M28.4165 15.1043C28.2504 14.9183 28.0678 14.7485 27.8715 14.5963C27.8496 14.8109 27.8166 15.0253 27.7661 15.2381C27.7446 15.3729 27.7231 15.5086 27.6909 15.6561C26.8677 19.8738 24.0356 22.1131 19.5054 22.1131H17.7866L16.8619 27.9398C16.7848 28.4255 16.366 28.7831 15.8742 28.7831H14.7065L14.6245 29.3035C14.6126 29.3792 14.6064 29.4558 14.6064 29.5324C14.6061 30.3425 15.2626 30.9995 16.0728 30.9999H19.3071C20.1728 31.0071 20.9153 30.3839 21.0582 29.5301L21.6988 25.4988L21.7095 25.4442H22.0084C26.0406 25.4442 28.5591 23.451 29.2935 19.6815C29.7479 18.1032 29.4221 16.4029 28.4165 15.1043Z'
fill='#FF4C51'
/>
</svg>
)
},
{
asset: (
<svg width='40' height='41' viewBox='0 0 40 41' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M0 6.59997C0 3.28627 2.68629 0.599976 6 0.599976H34C37.3137 0.599976 40 3.28627 40 6.59998V34.6C40 37.9137 37.3137 40.6 34 40.6H6C2.68629 40.6 0 37.9137 0 34.6V6.59997Z'
fill='#8C57FF'
fill-opacity='0.16'
/>
<path
d='M10 13.9333C10 15.1606 10.9949 16.1556 12.2222 16.1556H12.2222H27.7778C29.0051 16.1556 30 17.1505 30 18.3778V27.2667C30 28.494 29.0051 29.4889 27.7778 29.4889H12.2222C10.9949 29.4889 10 28.494 10 27.2667V13.9333Z'
fill='#E0CFFE'
/>
<path
d='M12.2222 16.1555H25.5555V13.7111C25.5555 12.6065 24.6602 11.7111 23.5555 11.7111H12C10.8954 11.7111 10 12.6065 10 13.7111V13.9333C10 15.1606 10.9949 16.1555 12.2222 16.1555Z'
fill='#B992FE'
/>
<path
d='M30.0001 25.6001H27.1185C25.6578 25.6266 24.3795 24.6232 24.0582 23.198C23.7307 21.5711 24.784 19.9867 26.4109 19.6592C26.6049 19.6201 26.8022 19.6004 27.0001 19.6001H30.0001V25.6001Z'
fill='#9155FD'
/>
</svg>
)
},
{
asset: (
<svg width='40' height='41' viewBox='0 0 40 41' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M0 6.19995C0 2.88624 2.68629 0.199951 6 0.199951H34C37.3137 0.199951 40 2.88624 40 6.19995V34.2C40 37.5137 37.3137 40.2 34 40.2H6C2.68629 40.2 0 37.5137 0 34.2V6.19995Z'
fill='#56CA00'
fill-opacity='0.16'
/>
<path d='M30 16.7H10V18.7H30V16.7Z' fill='#D0F0B8' />
<path
d='M27 12.7H13C11.3451 12.7048 10.0048 14.0451 10 15.7V16.7H30V15.7C29.9952 14.0451 28.6549 12.7048 27 12.7ZM10 24.7C10.0049 26.3548 11.3451 27.6951 13 27.7H27C28.6549 27.6951 29.9951 26.3548 30 24.7V18.7H10V24.7Z'
fill='#A7E37A'
/>
<path
d='M18 22.7H15C14.4477 22.7 14 22.2522 14 21.7C14 21.1477 14.4477 20.7 15 20.7H18C18.5523 20.7 19 21.1477 19 21.7C19 22.2522 18.5523 22.7 18 22.7Z'
fill='#56CA00'
/>
</svg>
)
}
]

const CustomVerticalRadioSVG = () => {
const initialSelected: string = data.filter(item => item.isSelected)[data.filter(item => item.isSelected).length - 1]
.value

// States
const [selected, setSelected] = useState<string>(initialSelected)

const handleChange = (prop: string | ChangeEvent<HTMLInputElement>) => {
if (typeof prop === 'string') {
setSelected(prop)
} else {
setSelected((prop.target as HTMLInputElement).value)
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => {
return (
<CustomInputVertical
type='radio'
key={index}
data={{ ...item, asset: SVGs[index].asset }}
selected={selected}
name='custom-radios-icons'
handleChange={handleChange}
gridProps={{ sm: 4, xs: 12 }}
/>
)
})}
</Grid>
)
}

export default CustomVerticalRadioSVG
Custom Vertical Checkboxes With SVG

Backup

Backup every file from your project.

Encrypt

Translate your data to encrypted text.

Site Lock

Security tool to protect your website.


// React Imports
import { useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Type Imports
import { CustomInputVerticalData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputVertical from '@core/components/custom-inputs/Vertical'

type Data = Omit<CustomInputVerticalData, 'asset'>

const data: Data[] = [
{
value: 'backup',
title: 'Backup',
isSelected: true,
content: 'Backup every file from your project.'
},
{
value: 'encrypt',
title: 'Encrypt',
content: 'Translate your data to encrypted text.'
},
{
value: 'site-lock',
title: 'Site Lock',
content: 'Security tool to protect your website.'
}
]

const SVGs = [
{
asset: (
<svg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'>
<rect width='40' height='40' rx='6' fill='#8C57FF' fill-opacity='0.16' />
<path
d='M23.7074 13.293L20.7074 10.293C20.5199 10.1056 20.2656 10.0002 20.0004 10.0002C19.7352 10.0002 19.4809 10.1056 19.2934 10.293L16.2934 13.293C16.1112 13.4816 16.0105 13.7342 16.0127 13.9964C16.015 14.2586 16.1202 14.5094 16.3056 14.6948C16.491 14.8803 16.7418 14.9854 17.004 14.9877C17.2662 14.99 17.5188 14.8892 17.7074 14.707L19.0004 13.414V25C19.0004 25.2652 19.1058 25.5196 19.2933 25.7071C19.4808 25.8947 19.7352 26 20.0004 26C20.2656 26 20.52 25.8947 20.7075 25.7071C20.895 25.5196 21.0004 25.2652 21.0004 25V13.414L22.2934 14.707C22.482 14.8892 22.7346 14.99 22.9968 14.9877C23.259 14.9854 23.5098 14.8803 23.6952 14.6948C23.8806 14.5094 23.9858 14.2586 23.9881 13.9964C23.9904 13.7342 23.8896 13.4816 23.7074 13.293Z'
fill='#8C57FF'
/>
<path
d='M26 17H21V25C21 25.2652 20.8946 25.5196 20.7071 25.7071C20.5196 25.8946 20.2652 26 20 26C19.7348 26 19.4804 25.8946 19.2929 25.7071C19.1054 25.5196 19 25.2652 19 25V17H14C13.2046 17.0008 12.442 17.3171 11.8796 17.8796C11.3171 18.442 11.0008 19.2046 11 20V27C11.0008 27.7954 11.3171 28.558 11.8796 29.1204C12.442 29.6829 13.2046 29.9992 14 30H26C26.7954 29.9992 27.558 29.6829 28.1204 29.1204C28.6829 28.558 28.9992 27.7954 29 27V20C28.9992 19.2046 28.6829 18.442 28.1204 17.8796C27.558 17.3171 26.7954 17.0008 26 17Z'
fill='#8C57FF'
fill-opacity='0.38'
/>
</svg>
)
},
{
asset: (
<svg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'>
<rect width='40' height='40' rx='6' fill='#8C57FF' fill-opacity='0.16' />
<path
d='M22 19H21V18C21 17.7348 20.8946 17.4804 20.7071 17.2929C20.5196 17.1054 20.2652 17 20 17C19.7348 17 19.4804 17.1054 19.2929 17.2929C19.1054 17.4804 19 17.7348 19 18V19H18C17.7348 19 17.4804 19.1054 17.2929 19.2929C17.1054 19.4804 17 19.7348 17 20C17 20.2652 17.1054 20.5196 17.2929 20.7071C17.4804 20.8946 17.7348 21 18 21H19V22C19 22.2652 19.1054 22.5196 19.2929 22.7071C19.4804 22.8946 19.7348 23 20 23C20.2652 23 20.5196 22.8946 20.7071 22.7071C20.8946 22.5196 21 22.2652 21 22V21H22C22.2652 21 22.5196 20.8946 22.7071 20.7071C22.8946 20.5196 23 20.2652 23 20C23 19.7348 22.8946 19.4804 22.7071 19.2929C22.5196 19.1054 22.2652 19 22 19Z'
fill='#8C57FF'
/>
<path
d='M27.63 11.65C27.5146 11.5563 27.3798 11.4895 27.2354 11.4544C27.0909 11.4193 26.9405 11.4168 26.795 11.447C25.7262 11.6727 24.6225 11.6767 23.5521 11.4587C22.4817 11.2408 21.4675 10.8056 20.572 10.18C20.4043 10.0628 20.2046 10 20 10C19.7954 10 19.5957 10.0628 19.428 10.18C18.5327 10.8058 17.5184 11.2412 16.448 11.4592C15.3775 11.6771 14.2738 11.673 13.205 11.447C13.0593 11.4165 12.9087 11.4188 12.7641 11.454C12.6195 11.4891 12.4845 11.556 12.369 11.6499C12.2536 11.7438 12.1605 11.8623 12.0967 11.9967C12.0329 12.1312 11.9998 12.2781 12 12.427V19.883C12.0015 21.3153 12.3441 22.7267 12.9996 24.0004C13.655 25.274 14.6043 26.3732 15.769 27.207L19.419 29.814C19.5886 29.935 19.7917 30.0001 20 30.0001C20.2083 30.0001 20.4114 29.935 20.581 29.814L24.231 27.207C25.3958 26.3733 26.3452 25.2741 27.0007 24.0005C27.6561 22.7268 27.9987 21.3154 28 19.883V12.426C27.9998 12.2773 27.9666 12.1305 27.9025 11.9962C27.8385 11.862 27.7454 11.7437 27.63 11.65ZM22 21H21V22C21 22.2652 20.8946 22.5195 20.7071 22.7071C20.5196 22.8946 20.2652 23 20 23C19.7348 23 19.4804 22.8946 19.2929 22.7071C19.1054 22.5195 19 22.2652 19 22V21H18C17.7348 21 17.4804 20.8946 17.2929 20.7071C17.1054 20.5195 17 20.2652 17 20C17 19.7347 17.1054 19.4804 17.2929 19.2929C17.4804 19.1053 17.7348 19 18 19H19V18C19 17.7347 19.1054 17.4804 19.2929 17.2929C19.4804 17.1053 19.7348 17 20 17C20.2652 17 20.5196 17.1053 20.7071 17.2929C20.8946 17.4804 21 17.7347 21 18V19H22C22.2652 19 22.5196 19.1053 22.7071 19.2929C22.8946 19.4804 23 19.7347 23 20C23 20.2652 22.8946 20.5195 22.7071 20.7071C22.5196 20.8946 22.2652 21 22 21Z'
fill='#8C57FF'
fill-opacity='0.38'
/>
</svg>
)
},
{
asset: (
<svg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'>
<rect width='40' height='40' rx='6' fill='#8C57FF' fill-opacity='0.16' />
<path
d='M17 15C17 14.2044 17.3161 13.4413 17.8787 12.8787C18.4413 12.3161 19.2044 12 20 12C20.7956 12 21.5587 12.3161 22.1213 12.8787C22.6839 13.4413 23 14.2044 23 15V17H25V15C25 13.6739 24.4732 12.4021 23.5355 11.4645C22.5979 10.5268 21.3261 10 20 10C18.6739 10 17.4021 10.5268 16.4645 11.4645C15.5268 12.4021 15 13.6739 15 15V17H17V15ZM20 26C19.7348 26 19.4804 25.8946 19.2929 25.7071C19.1054 25.5196 19 25.2652 19 25V22C19 21.7348 19.1054 21.4804 19.2929 21.2929C19.4804 21.1054 19.7348 21 20 21C20.2652 21 20.5196 21.1054 20.7071 21.2929C20.8946 21.4804 21 21.7348 21 22V25C21 25.2652 20.8946 25.5196 20.7071 25.7071C20.5196 25.8946 20.2652 26 20 26Z'
fill='#8C57FF'
fill-opacity='0.38'
/>
<path
d='M25 17H15C14.2044 17 13.4413 17.3161 12.8787 17.8787C12.3161 18.4413 12 19.2044 12 20V27C12 27.7956 12.3161 28.5587 12.8787 29.1213C13.4413 29.6839 14.2044 30 15 30H25C25.7956 30 26.5587 29.6839 27.1213 29.1213C27.6839 28.5587 28 27.7956 28 27V20C28 19.2044 27.6839 18.4413 27.1213 17.8787C26.5587 17.3161 25.7956 17 25 17ZM21 25C21 25.2652 20.8946 25.5196 20.7071 25.7071C20.5196 25.8946 20.2652 26 20 26C19.7348 26 19.4804 25.8946 19.2929 25.7071C19.1054 25.5196 19 25.2652 19 25V22C19 21.7348 19.1054 21.4804 19.2929 21.2929C19.4804 21.1054 19.7348 21 20 21C20.2652 21 20.5196 21.1054 20.7071 21.2929C20.8946 21.4804 21 21.7348 21 22V25Z'
fill='#8C57FF'
/>
</svg>
)
}
]

const CustomVerticalCheckboxIcon = () => {
const initialSelected: string[] = data.filter(item => item.isSelected).map(item => item.value)

// States
const [selected, setSelected] = useState<string[]>(initialSelected)

const handleChange = (value: string) => {
if (selected.includes(value)) {
const updatedArr = selected.filter(item => item !== value)
setSelected(updatedArr)
} else {
setSelected([...selected, value])
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => {
return (
<CustomInputVertical
type='checkbox'
key={index}
selected={selected}
data={{ ...item, asset: SVGs[index].asset }}
handleChange={handleChange}
name='custom-checkbox-icons'
gridProps={{ sm: 4, xs: 12 }}
/>
)
})}
</Grid>
)
}

export default CustomVerticalCheckboxIcon
Custom Radios with Images
checkbox-image-clock
checkbox-image-donuts
checkbox-image-flowers

// React Imports
import { ChangeEvent, useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Type Import
import { CustomInputImgData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputImg from '@core/components/custom-inputs/Image'

const data: CustomInputImgData[] = [
{
value: 'clock',
isSelected: true,
img: '/images/banners/27.jpg'
},
{
value: 'donuts',
img: '/images/banners/26.jpg'
},
{
value: 'flowers',
img: '/images/banners/22.jpg'
}
]

const CustomRadioWithImage = () => {
const initialSelected: string = data.filter(item => item.isSelected)[data.filter(item => item.isSelected).length - 1]
.value

// States
const [selected, setSelected] = useState<string>(initialSelected)

const handleChange = (prop: string | ChangeEvent<HTMLInputElement>) => {
if (typeof prop === 'string') {
setSelected(prop)
} else {
setSelected((prop.target as HTMLInputElement).value)
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => (
<CustomInputImg
type='radio'
key={index}
data={item}
selected={selected}
name='custom-radios-img'
handleChange={handleChange}
gridProps={{ sm: 4, xs: 12 }}
/>
))}
</Grid>
)
}

export default CustomRadioWithImage
Custom Checkboxes with Images
checkbox-image-clock
checkbox-image-donuts
checkbox-image-flowers

// React Imports
import { useState } from 'react'

// MUI Imports
import Grid from '@mui/material/Grid'

// Type Import
import { CustomInputImgData } from '@core/components/custom-inputs/types'

// Components Imports
import CustomInputImg from '@core/components/custom-inputs/Image'

const data: CustomInputImgData[] = [
{
value: 'clock',
isSelected: true,
img: '/images/banners/27.jpg'
},
{
value: 'donuts',
img: '/images/banners/26.jpg'
},
{
value: 'flowers',
img: '/images/banners/22.jpg'
}
]

const CustomCheckboxWithImage = () => {
const initialSelected: string[] = data.filter(item => item.isSelected).map(item => item.value)

// States
const [selected, setSelected] = useState<string[]>(initialSelected)

const handleChange = (value: string) => {
if (selected.includes(value)) {
const updatedArr = selected.filter(item => item !== value)
setSelected(updatedArr)
} else {
setSelected([...selected, value])
}
}

return (
<Grid container spacing={4}>
{data.map((item, index) => (
<CustomInputImg
type='checkbox'
key={index}
data={item}
selected={selected}
name='custom-checkbox-img'
handleChange={handleChange}
gridProps={{ sm: 4, xs: 12 }}
/>
))}
</Grid>
)
}

export default CustomCheckboxWithImage