UNPKG

2.87 kBTypeScriptView Raw
1import React from 'react';
2import { Except } from 'type-fest';
3import { Styles } from '../styles';
4import { DOMElement } from '../dom';
5export declare type Props = Except<Styles, 'textWrap'> & {
6 /**
7 * Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft` and `marginRight`.
8 *
9 * @default 0
10 */
11 readonly margin?: number;
12 /**
13 * Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
14 *
15 * @default 0
16 */
17 readonly marginX?: number;
18 /**
19 * Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
20 *
21 * @default 0
22 */
23 readonly marginY?: number;
24 /**
25 * Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft` and `paddingRight`.
26 *
27 * @default 0
28 */
29 readonly padding?: number;
30 /**
31 * Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
32 *
33 * @default 0
34 */
35 readonly paddingX?: number;
36 /**
37 * Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
38 *
39 * @default 0
40 */
41 readonly paddingY?: number;
42};
43/**
44 * `<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
45 */
46declare const Box: React.ForwardRefExoticComponent<Pick<Styles, "position" | "marginLeft" | "marginRight" | "marginTop" | "marginBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "paddingBottom" | "flexGrow" | "flexShrink" | "flexDirection" | "flexBasis" | "alignItems" | "alignSelf" | "justifyContent" | "width" | "height" | "minWidth" | "minHeight" | "display" | "borderStyle" | "borderColor"> & {
47 /**
48 * Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft` and `marginRight`.
49 *
50 * @default 0
51 */
52 readonly margin?: number | undefined;
53 /**
54 * Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
55 *
56 * @default 0
57 */
58 readonly marginX?: number | undefined;
59 /**
60 * Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
61 *
62 * @default 0
63 */
64 readonly marginY?: number | undefined;
65 /**
66 * Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft` and `paddingRight`.
67 *
68 * @default 0
69 */
70 readonly padding?: number | undefined;
71 /**
72 * Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
73 *
74 * @default 0
75 */
76 readonly paddingX?: number | undefined;
77 /**
78 * Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
79 *
80 * @default 0
81 */
82 readonly paddingY?: number | undefined;
83} & {
84 children?: React.ReactNode;
85} & React.RefAttributes<DOMElement>>;
86export default Box;