tuil
ReferenceComponentsLayout and panes

BoxProps

BoxProps component contract.

View rawEdit

Type

export type BoxProps = TuilBoxProps;

Members

MemberTypeRequiredDescriptionRelated types
paddingnumber | SpacingToken | undefinedNoThe padding member uses the number | SpacingToken | undefined contract.SpacingToken
marginnumber | SpacingToken | undefinedNoThe margin member uses the number | SpacingToken | undefined contract.SpacingToken
childrenReactNodeNoThe children member uses the ReactNode contract.
position"absolute" | "relative" | "static" | undefinedNoControls how the element is positioned. When position is static, top, right, bottom, and left are ignored.
topstring | number | undefinedNoTop offset for positioned elements.
rightstring | number | undefinedNoRight offset for positioned elements.
bottomstring | number | undefinedNoBottom offset for positioned elements.
leftstring | number | undefinedNoLeft offset for positioned elements.
columnGapnumber | undefinedNoSize of the gap between an element's columns.
rowGapnumber | undefinedNoSize of the gap between an element's rows.
gapnumber | undefinedNoSize of the gap between an element's columns and rows. A shorthand for columnGap and rowGap.
marginXnumber | undefinedNoHorizontal margin. Equivalent to setting marginLeft and marginRight.
marginYnumber | undefinedNoVertical margin. Equivalent to setting marginTop and marginBottom.
marginTopnumber | undefinedNoTop margin.
marginBottomnumber | undefinedNoBottom margin.
marginLeftnumber | undefinedNoLeft margin.
marginRightnumber | undefinedNoRight margin.
paddingXnumber | undefinedNoHorizontal padding. Equivalent to setting paddingLeft and paddingRight.
paddingYnumber | undefinedNoVertical padding. Equivalent to setting paddingTop and paddingBottom.
paddingTopnumber | undefinedNoTop padding.
paddingBottomnumber | undefinedNoBottom padding.
paddingLeftnumber | undefinedNoLeft padding.
paddingRightnumber | undefinedNoRight padding.
flexGrownumber | undefinedNoThis property defines the ability for a flex item to grow if necessary. See flex-grow.
flexShrinknumber | undefinedNoIt specifies the “flex shrink factor”, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn’t enough space on the row. See flex-shrink.
flexDirection"row" | "column" | "row-reverse" | "column-reverse" | undefinedNoIt establishes the main-axis, thus defining the direction flex items are placed in the flex container. See flex-direction.
flexBasisstring | number | undefinedNoIt specifies the initial size of the flex item, before any available space is distributed according to the flex factors. See flex-basis.
flexWrap"nowrap" | "wrap" | "wrap-reverse" | undefinedNoIt defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in. See flex-wrap.
alignItems"flex-start" | "center" | "flex-end" | "stretch" | "baseline" | undefinedNoThe align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis). See align-items.
alignSelf"flex-start" | "center" | "flex-end" | "stretch" | "baseline" | "auto" | undefinedNoIt makes possible to override the align-items value for specific flex items. See align-self.
alignContent"flex-start" | "center" | "flex-end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefinedNoIt defines the alignment along the cross axis when there are multiple lines of flex items (when using flex-wrap). See align-content.
justifyContent"flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly" | undefinedNoIt defines the alignment along the main axis. See justify-content.
widthstring | number | undefinedNoWidth of the element in spaces. You can also set it as a percentage, which will calculate the width based on the width of the parent element.
heightstring | number | undefinedNoHeight of the element in lines (rows). You can also set it as a percentage, which will calculate the height based on the height of the parent element.
minWidthstring | number | undefinedNoSets a minimum width of the element. Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
minHeightstring | number | undefinedNoSets a minimum height of the element in lines (rows). You can also set it as a percentage, which will calculate the minimum height based on the height of the parent element.
maxWidthstring | number | undefinedNoSets a maximum width of the element. Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
maxHeightstring | number | undefinedNoSets a maximum height of the element in lines (rows). You can also set it as a percentage, which will calculate the maximum height based on the height of the parent element.
aspectRationumber | undefinedNoDefines the aspect ratio (width/height) for the element. Use it with at least one size constraint (width, height, minHeight, or maxHeight) so Ink can derive the missing dimension.
display"none" | "flex" | undefinedNoSet this property to none to hide the element.
borderStylekeyof Boxes | BoxStyle | undefinedNoAdd a border with a specified style. If borderStyle is undefined (the default), no border will be added.
borderTopboolean | undefinedNoDetermines whether the top border is visible.
borderBottomboolean | undefinedNoDetermines whether the bottom border is visible.
borderLeftboolean | undefinedNoDetermines whether the left border is visible.
borderRightboolean | undefinedNoDetermines whether the right border is visible.
borderColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange border color. A shorthand for setting borderTopColor, borderRightColor, borderBottomColor, and borderLeftColor.
borderTopColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange the top border color. Accepts the same values as color in Text component.
borderBottomColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange the bottom border color. Accepts the same values as color in Text component.
borderLeftColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange the left border color. Accepts the same values as color in Text component.
borderRightColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange the right border color. Accepts the same values as color in Text component.
borderDimColorboolean | undefinedNoDim the border color. A shorthand for setting borderTopDimColor, borderBottomDimColor, borderLeftDimColor, and borderRightDimColor.
borderTopDimColorboolean | undefinedNoDim the top border color.
borderBottomDimColorboolean | undefinedNoDim the bottom border color.
borderLeftDimColorboolean | undefinedNoDim the left border color.
borderRightDimColorboolean | undefinedNoDim the right border color.
borderBackgroundColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange border background color. A shorthand for setting borderTopBackgroundColor, borderRightBackgroundColor, borderBottomBackgroundColor, and borderLeftBackgroundColor.
borderTopBackgroundColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange top border background color. Accepts the same values as backgroundColor in Text component.
borderBottomBackgroundColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange bottom border background color. Accepts the same values as backgroundColor in Text component.
borderLeftBackgroundColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange left border background color. Accepts the same values as backgroundColor in Text component.
borderRightBackgroundColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoChange right border background color. Accepts the same values as backgroundColor in Text component.
overflow"visible" | "hidden" | undefinedNoBehavior for an element's overflow in both directions.
overflowX"visible" | "hidden" | undefinedNoBehavior for an element's overflow in the horizontal direction.
overflowY"visible" | "hidden" | undefinedNoBehavior for an element's overflow in the vertical direction.
backgroundColorLiteralUnion<keyof import("ansi-styles").ForegroundColor, string> | undefinedNoBackground color for the element. Accepts the same values as color in the <Text> component.
aria-labelstring | undefinedNoA label for the element for screen readers.
aria-hiddenboolean | undefinedNoHide the element from screen readers.
aria-role"button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar" | undefinedNoThe role of the element.
aria-state&#123; readonly busy?: boolean; readonly checked?: boolean; readonly disabled?: boolean; readonly expanded?: boolean; readonly multiline?: boolean; readonly multiselectable?: boolean; readonly readonly?: boolean; readonly required?: boolean; readonly selected?: boolean; &#125; | undefinedNoThe state of the element.
variantstring | undefinedNoThe variant member uses the string | undefined contract.
size"sm" | "md" | "lg" | undefinedNoThe size member uses the "sm" | "md" | "lg" | undefined contract.
unstyledboolean | undefinedNoThe unstyled member uses the boolean | undefined contract.
classNamestring | undefinedNoThe className member uses the string | undefined contract.
layoutPartial<Omit<LayoutNodeInput, "children" | "id" | "semantics">> | undefinedNoThe layout member uses the Partial<Omit<LayoutNodeInput, "children" | "id" | "semantics">> | undefined contract.
idstring | undefinedNoThe id member uses the string | undefined contract.
testIdstring | undefinedNoThe testId member uses the string | undefined contract.
roleSemanticRole | undefinedNoThe role member uses the SemanticRole | undefined contract.SemanticRole
labelstring | undefinedNoThe label member uses the string | undefined contract.
descriptionstring | undefinedNoThe description member uses the string | undefined contract.
disabledboolean | undefinedNoThe disabled member uses the boolean | undefined contract.
readOnlyboolean | undefinedNoThe readOnly member uses the boolean | undefined contract.
selectedboolean | undefinedNoThe selected member uses the boolean | undefined contract.
checkedboolean | undefinedNoThe checked member uses the boolean | undefined contract.
expandedboolean | undefinedNoThe expanded member uses the boolean | undefined contract.
valueTextstring | undefinedNoThe valueText member uses the string | undefined contract.
slotsPartial<SlotComponents<&#123; root: import("ink").BoxProps; &#125;>> | undefinedNoThe slots member uses the Partial<SlotComponents<&#123; root: import("ink").BoxProps; &#125;>> | undefined contract.BoxProps, SlotComponents
slotPropsPartial<SlotProps<&#123; root: import("ink").BoxProps; &#125;, object>> | undefinedNoThe slotProps member uses the Partial<SlotProps<&#123; root: import("ink").BoxProps; &#125;, object>> | undefined contract.BoxProps, SlotProps

Source

View the secondary source reference

On this page