import * as React from 'react'; import Checkbox from '@mui/joy/Checkbox'; import List from '@mui/joy/List'; import ListItem from '@mui/joy/ListItem'; import Typography from '@mui/joy/Typography'; import Sheet from '@mui/joy/Sheet'; import Done from '@mui/icons-material/Done'; export default function ExampleChoiceChipCheckbox() { const [value, setValue] = React.useState([]); return ( Choose amenities
{['Elevator', 'Washer/Dryer', 'Fireplace', 'Dogs ok', 'Cats ok'].map( (item, index) => ( {value.includes(item) && ( )} ) => { if (event.target.checked) { setValue((val) => [...val, item]); } else { setValue((val) => val.filter((text) => text !== item)); } }} slotProps={{ action: ({ checked }) => ({ sx: checked ? { border: '1px solid', borderColor: 'primary.500', } : {}, }), }} /> ), )}
); }