Yana Trifonova
Yana Trifonova

Reputation: 641

Material UI MuiClockPicker style overrides

I am curious how can I override styles for MuiClockPicker?

I find out that this override at createTheme actually works for me, but I recived an error from a typescript:

TS2322: Type '{ MuiOutlinedInput: { styleOverrides: { root: { color: string; border: string; }; }; }; MuiInputLabel: { styleOverrides: { root: { color: string; backgroundColor: string; paddingRight: string; paddingLeft: string; }; }; }; ... 4 more ...; MuiClockPicker: { ...; }; }' is not assignable to type 'Components'.   Object literal may only specify known properties, and 'MuiClockPicker' does not exist in type 'Components'.

Here is a code:

import { createTheme } from '@mui/material/styles'

export const theme = createTheme({
...
    components: {
        MuiClockPicker: {
            styleOverrides: {
                arrowSwitcher: {
                    display: 'none',
                },
            },
        },
    },
})

Upvotes: 0

Views: 545

Answers (1)

Yana Trifonova
Yana Trifonova

Reputation: 641

This is the only way I found, but definitely it is not the best solution:

button[aria-label='open previous view'] {
    display: none;
}

button[aria-label='open next view'] {
    display: none;
}

Upvotes: 0

Related Questions