[material-ui][Link] Allow type overrides for default component
Author: FoHoOVCreated Feb 6, 2025Updated Sep 1, 2026
Labelswaiting for 👍scope: linktype: enhancementhas workaround
Summary
Currently in order to integrate other framework Link components into mui (globally) we can use
export const theme = createTheme({
components: {
MuiLink: {
defaultProps: {
component: Link,
},
},
}
});
but we can't type this correctly witht what is provided for us. Other solutions are creating a custom Link component and type the props ourselves.
This would be much simpler if we could do something like:
import type NextLink from "next/link";
declare module "@mui/material/Link" {
export interface LinkComponentOverride {
component: typeof NextLink;
}
}
export {};
Examples
No response
Motivation
No response
Search keywords: link typeoverrides
Source: mui/material-ui