UNPKG

ink

Version:
87 lines (86 loc) 2.55 kB
import React from 'react'; import { type Except } from 'type-fest'; import { type Styles } from '../styles.js'; import { type DOMElement } from '../dom.js'; export type Props = Except<Styles, 'textWrap'> & { /** * Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft` and `marginRight`. * * @default 0 */ readonly margin?: number; /** * Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`. * * @default 0 */ readonly marginX?: number; /** * Vertical margin. Equivalent to setting `marginTop` and `marginBottom`. * * @default 0 */ readonly marginY?: number; /** * Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft` and `paddingRight`. * * @default 0 */ readonly padding?: number; /** * Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`. * * @default 0 */ readonly paddingX?: number; /** * Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`. * * @default 0 */ readonly paddingY?: number; }; /** * `<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser. */ declare const Box: React.ForwardRefExoticComponent<Except<Styles, "textWrap"> & { /** * Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft` and `marginRight`. * * @default 0 */ readonly margin?: number | undefined; /** * Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`. * * @default 0 */ readonly marginX?: number | undefined; /** * Vertical margin. Equivalent to setting `marginTop` and `marginBottom`. * * @default 0 */ readonly marginY?: number | undefined; /** * Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft` and `paddingRight`. * * @default 0 */ readonly padding?: number | undefined; /** * Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`. * * @default 0 */ readonly paddingX?: number | undefined; /** * Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`. * * @default 0 */ readonly paddingY?: number | undefined; } & { children?: React.ReactNode; } & React.RefAttributes<DOMElement>>; export default Box;