Link
The Link component builds on the Typography component and provides convenient props to handle common link styling patterns.Basic Links
The Link component is built on top of the Typography component, meaning that you can use its props.Underline
Theunderline prop controls when the link should be underlined.
Color
Use thecolor prop to apply theme color palette.
Typography Variants
The Link component inherits Typography props, includingvariant.
Button as Link
Render the link as a button element.External Links
For external links, always set appropriate security attributes.Integration with Routing Libraries
React Router
Next.js
Accessible Links
Provide meaningful link text for screen readers.Props
color
- Type:
'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'textPrimary' | 'textSecondary' | 'textDisabled' - Default:
'primary' - Description: The color of the link. It supports theme colors and typography colors
underline
- Type:
'none' | 'hover' | 'always' - Default:
'always' - Description: Controls when the link should have an underline
variant
- Type: Typography variant
- Default:
'inherit' - Description: Applies the theme typography styles
component
- Type:
React.ElementType - Default:
'a' - Description: The component used for the root node. Either a string to use an HTML element or a component
href
- Type:
string - Description: The URL to link to when clicked. Standard anchor element attribute
TypographyClasses
- Type:
TypographyProps['classes'] - Description: Classes prop applied to the Typography element
sx
- Type:
SxProps<Theme> - Description: System prop for defining CSS styles
Accessibility
- Use descriptive link text that makes sense out of context
- Avoid generic text like “click here” or “read more”
- For external links, consider adding visual indicators
- When using
component="button", ensure proper ARIA attributes - Links inherit keyboard navigation from the underlying HTML element
Security
When linking to external sites:rel="noopener"prevents the new page from accessingwindow.openerrel="noreferrer"prevents the browser from sending the HTTP referer header