UNPKG

1.19 kBTypeScriptView Raw
1import * as React from 'react';
2import { OverridableComponent, OverrideProps } from '../OverridableComponent';
3import { Omit } from '@material-ui/types';
4import { TypographyProps } from '../Typography';
5
6export interface LinkTypeMap<P = {}, D extends React.ElementType = 'a'> {
7 props: P &
8 LinkBaseProps & {
9 TypographyClasses?: TypographyProps['classes'];
10 underline?: 'none' | 'hover' | 'always';
11 };
12 defaultComponent: D;
13 classKey: LinkClassKey;
14}
15
16/**
17 *
18 * Demos:
19 *
20 * - [Breadcrumbs](https://mui.com/components/breadcrumbs/)
21 * - [Links](https://mui.com/components/links/)
22 *
23 * API:
24 *
25 * - [Link API](https://mui.com/api/link/)
26 * - inherits [Typography API](https://mui.com/api/typography/)
27 */
28declare const Link: OverridableComponent<LinkTypeMap>;
29
30export type LinkClassKey =
31 | 'root'
32 | 'underlineNone'
33 | 'underlineHover'
34 | 'underlineAlways'
35 | 'button'
36 | 'focusVisible';
37
38export type LinkBaseProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &
39 Omit<TypographyProps, 'component'>;
40
41export type LinkProps<
42 D extends React.ElementType = LinkTypeMap['defaultComponent'],
43 P = {}
44> = OverrideProps<LinkTypeMap<P, D>, D>;
45
46export default Link;