Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
Is it not possible to style a nested component within MUI's 'styled()' function?

As you can see below, I am trying to style an MUI Stack component within an MUI Dialog component, but the Stack styles are not being applied in my code:

const CustomDialog = styled(Dialog)(({ theme }) => ({

    '& .MuiDialog-paper': {
        backgroundColor: theme.palette.error.light,
        color: theme.palette.background.default,
        textAlign: 'center',
    },
    '& .MuiDialogContent-root': {
        marginTop: 2,
        marginBottom: 2,
    },
    '& .MuiStack-root': {
        direction: 'row',
        spacing: 1,
        padding: 1,
    },
    '& .MuiButton-root': {

        ':first-of-type': {
            color: theme.palette.error.light,
            backgroundColor: theme.palette.background.default,
            ':hover': {
                backgroundColor: theme.palette.error.dark
            }
        },
        ':last-of-type': {
            backgroundColor: theme.palette.success.main,
            ':hover': {
                backgroundColor: theme.palette.success.dark
            }
        }


    }

}));

And here is the CustomDialog in action:

    <CustomDialog>
        <DialogTitle>
            ...
        </DialogTitle>

        <DialogContent>
            ...
        </DialogContent>

        <Stack>
            <Button>
                ...
            </Button>

            <Button>
                ...
            </Button>
        </Stack>

    </CustomDialog>;

The Stack should be aligning the buttons next to each other, but they are still on top of each other vertically

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

At the Stack you can add direction prop to setting that the way you want, I provide the code example you can try.

<Stack direction="row">
            <Button>
               ...
            </Button>

            <Button>
                ...
            </Button>
        </Stack>

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda