UNPKG

2.05 kBTypeScriptView Raw
1import * as React from 'react';
2import { Breakpoint } from '../styles/createBreakpoints';
3
4export interface HiddenProps {
5 /**
6 * Specify which implementation to use. 'js' is the default, 'css' works better for
7 * server-side rendering.
8 */
9 implementation?: 'js' | 'css';
10 /**
11 * You can use this prop when choosing the `js` implementation with server-side rendering.
12 *
13 * As `window.innerWidth` is unavailable on the server,
14 * we default to rendering an empty component during the first mount.
15 * You might want to use an heuristic to approximate
16 * the screen width of the client browser screen width.
17 *
18 * For instance, you could be using the user-agent or the client-hints.
19 * https://caniuse.com/#search=client%20hint
20 */
21 initialWidth?: Breakpoint;
22 /**
23 * If `true`, screens this size and down will be hidden.
24 */
25 lgDown?: boolean;
26 /**
27 * If `true`, screens this size and up will be hidden.
28 */
29 lgUp?: boolean;
30 /**
31 * If `true`, screens this size and down will be hidden.
32 */
33 mdDown?: boolean;
34 /**
35 * If `true`, screens this size and up will be hidden.
36 */
37 mdUp?: boolean;
38 /**
39 * Hide the given breakpoint(s).
40 */
41 only?: Breakpoint | Breakpoint[];
42 /**
43 * If `true`, screens this size and down will be hidden.
44 */
45 smDown?: boolean;
46 /**
47 * If `true`, screens this size and up will be hidden.
48 */
49 smUp?: boolean;
50 /**
51 * If `true`, screens this size and down will be hidden.
52 */
53 xlDown?: boolean;
54 /**
55 * If `true`, screens this size and up will be hidden.
56 */
57 xlUp?: boolean;
58 /**
59 * If `true`, screens this size and down will be hidden.
60 */
61 xsDown?: boolean;
62 /**
63 * If `true`, screens this size and up will be hidden.
64 */
65 xsUp?: boolean;
66}
67
68/**
69 * Responsively hides children based on the selected implementation.
70 * Demos:
71 *
72 * - [Hidden](https://mui.com/components/hidden/)
73 *
74 * API:
75 *
76 * - [Hidden API](https://mui.com/api/hidden/)
77 */
78declare const Hidden: React.ComponentType<HiddenProps>;
79
80export default Hidden;