/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/data/material/components/autocomplete/DisabledOptions.js
23 строки
640 B
Brijesh Bittu
[code-infra] Remove React import requirement for jsx (#47146)
29 окт 2025, 20:55
Не верифицирован
29 окт 2025, 20:55
6c9e82f
Код
Авторство
О чём код?
import TextField from '@mui/material/TextField'; import Autocomplete from '@mui/material/Autocomplete'; export default function DisabledOptions() { return ( <Autocomplete options={timeSlots} getOptionDisabled={(option) => option === timeSlots[0] || option === timeSlots[2] } sx={{ width: 300 }} renderInput={(params) => <TextField {...params} label="Disabled options" />} /> ); } // One time slot every 30 minutes. const timeSlots = Array.from(new Array(24 * 2)).map( (_, index) => `${index < 20 ? '0' : ''}${Math.floor(index / 2)}:${ index % 2 === 0 ? '00' : '30' }`, );