Interface: ScrollViewProps
Props for the ScrollView component.
Remarks
Extends standard BoxProps from Ink.
Extends
Props
Properties
alignItems?
readonlyoptionalalignItems:"flex-start"|"center"|"flex-end"|"stretch"
The 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 .
Inherited from
BoxProps.alignItems
alignSelf?
readonlyoptionalalignSelf:"flex-start"|"center"|"flex-end"|"auto"
It makes possible to override the align-items value for specific flex items. See align-self .
Inherited from
BoxProps.alignSelf
aria-hidden?
readonlyoptionalaria-hidden:boolean
Hide the element from screen readers.
Inherited from
BoxProps.aria-hidden
aria-label?
readonlyoptionalaria-label:string
A label for the element for screen readers.
Inherited from
BoxProps.aria-label
aria-role?
readonlyoptionalaria-role:"button"|"checkbox"|"combobox"|"list"|"listbox"|"listitem"|"menu"|"menuitem"|"option"|"progressbar"|"radio"|"radiogroup"|"tab"|"tablist"|"table"|"textbox"|"timer"|"toolbar"
The role of the element.
Inherited from
BoxProps.aria-role
aria-state?
readonlyoptionalaria-state:object
The state of the element.
busy?
readonlyoptionalbusy:boolean
checked?
readonlyoptionalchecked:boolean
disabled?
readonlyoptionaldisabled:boolean
expanded?
readonlyoptionalexpanded:boolean
multiline?
readonlyoptionalmultiline:boolean
multiselectable?
readonlyoptionalmultiselectable:boolean
readonly?
readonlyoptionalreadonly:boolean
required?
readonlyoptionalrequired:boolean
selected?
readonlyoptionalselected:boolean
Inherited from
BoxProps.aria-state
backgroundColor?
readonlyoptionalbackgroundColor:LiteralUnion<keyof ForegroundColor,string>
Background color for the element.
Accepts the same values as color in the <Text> component.
Inherited from
BoxProps.backgroundColor
borderBottom?
readonlyoptionalborderBottom:boolean
Determines whether bottom border is visible.
Default
true;Inherited from
BoxProps.borderBottom
borderBottomColor?
readonlyoptionalborderBottomColor:LiteralUnion<keyof ForegroundColor,string>
Change bottom border color. Accepts the same values as color in Text component.
Inherited from
BoxProps.borderBottomColor
borderBottomDimColor?
readonlyoptionalborderBottomDimColor:boolean
Dim the bottom border color.
Default
false;Inherited from
BoxProps.borderBottomDimColor
borderColor?
readonlyoptionalborderColor:LiteralUnion<keyof ForegroundColor,string>
Change border color. A shorthand for setting borderTopColor, borderRightColor, borderBottomColor, and borderLeftColor.
Inherited from
BoxProps.borderColor
borderDimColor?
readonlyoptionalborderDimColor:boolean
Dim the border color. A shorthand for setting borderTopDimColor, borderBottomDimColor, borderLeftDimColor, and borderRightDimColor.
Default
false;Inherited from
BoxProps.borderDimColor
borderLeft?
readonlyoptionalborderLeft:boolean
Determines whether left border is visible.
Default
true;Inherited from
BoxProps.borderLeft
borderLeftColor?
readonlyoptionalborderLeftColor:LiteralUnion<keyof ForegroundColor,string>
Change left border color. Accepts the same values as color in Text component.
Inherited from
BoxProps.borderLeftColor
borderLeftDimColor?
readonlyoptionalborderLeftDimColor:boolean
Dim the left border color.
Default
false;Inherited from
BoxProps.borderLeftDimColor
borderRight?
readonlyoptionalborderRight:boolean
Determines whether right border is visible.
Default
true;Inherited from
BoxProps.borderRight
borderRightColor?
readonlyoptionalborderRightColor:LiteralUnion<keyof ForegroundColor,string>
Change right border color. Accepts the same values as color in Text component.
Inherited from
BoxProps.borderRightColor
borderRightDimColor?
readonlyoptionalborderRightDimColor:boolean
Dim the right border color.
Default
false;Inherited from
BoxProps.borderRightDimColor
borderStyle?
readonlyoptionalborderStyle: keyof Boxes |BoxStyle
Add a border with a specified style. If borderStyle is undefined (the default), no border will be added.
Inherited from
BoxProps.borderStyle
borderTop?
readonlyoptionalborderTop:boolean
Determines whether top border is visible.
Default
true;Inherited from
BoxProps.borderTop
borderTopColor?
readonlyoptionalborderTopColor:LiteralUnion<keyof ForegroundColor,string>
Change top border color. Accepts the same values as color in Text component.
Inherited from
BoxProps.borderTopColor
borderTopDimColor?
readonlyoptionalborderTopDimColor:boolean
Dim the top border color.
Default
false;Inherited from
BoxProps.borderTopDimColor
children?
optionalchildren:ReactNode
The content to be scrolled.
Remarks
Accepts an array of React elements. Each element should have a unique key
prop, which will be preserved during rendering for proper reconciliation.
columnGap?
readonlyoptionalcolumnGap:number
Size of the gap between an element’s columns.
Inherited from
BoxProps.columnGap
debug?
optionaldebug:boolean
Enable debug mode to visualize the ScrollView internals.
Remarks
When enabled, the viewport overflow is not hidden, allowing the full content to be visible. This is useful for inspecting the layout and verifying that content is being rendered correctly off-screen.
display?
readonlyoptionaldisplay:"flex"|"none"
Set this property to none to hide the element.
Inherited from
BoxProps.display
flexBasis?
readonlyoptionalflexBasis:string|number
It specifies the initial size of the flex item, before any available space is distributed according to the flex factors. See flex-basis .
Inherited from
BoxProps.flexBasis
flexDirection?
readonlyoptionalflexDirection:"row"|"column"|"row-reverse"|"column-reverse"
It establishes the main-axis, thus defining the direction flex items are placed in the flex container. See flex-direction .
Inherited from
BoxProps.flexDirection
flexGrow?
readonlyoptionalflexGrow:number
This property defines the ability for a flex item to grow if necessary. See flex-grow .
Inherited from
BoxProps.flexGrow
flexShrink?
readonlyoptionalflexShrink:number
It 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 .
Inherited from
BoxProps.flexShrink
flexWrap?
readonlyoptionalflexWrap:"nowrap"|"wrap"|"wrap-reverse"
It 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 .
Inherited from
BoxProps.flexWrap
gap?
readonlyoptionalgap:number
Size of the gap between an element’s columns and rows. A shorthand for columnGap and rowGap.
Inherited from
BoxProps.gap
height?
readonlyoptionalheight:string|number
Height 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.
Inherited from
BoxProps.height
justifyContent?
readonlyoptionaljustifyContent:"flex-start"|"center"|"flex-end"|"space-between"|"space-around"|"space-evenly"
It defines the alignment along the main axis. See justify-content .
Inherited from
BoxProps.justifyContent
margin?
readonlyoptionalmargin:number
Margin on all sides. Equivalent to setting marginTop, marginBottom, marginLeft, and marginRight.
Inherited from
BoxProps.margin
marginBottom?
readonlyoptionalmarginBottom:number
Bottom margin.
Inherited from
BoxProps.marginBottom
marginLeft?
readonlyoptionalmarginLeft:number
Left margin.
Inherited from
BoxProps.marginLeft
marginRight?
readonlyoptionalmarginRight:number
Right margin.
Inherited from
BoxProps.marginRight
marginTop?
readonlyoptionalmarginTop:number
Top margin.
Inherited from
BoxProps.marginTop
marginX?
readonlyoptionalmarginX:number
Horizontal margin. Equivalent to setting marginLeft and marginRight.
Inherited from
BoxProps.marginX
marginY?
readonlyoptionalmarginY:number
Vertical margin. Equivalent to setting marginTop and marginBottom.
Inherited from
BoxProps.marginY
minHeight?
readonlyoptionalminHeight:string|number
Sets a minimum height of the element.
Inherited from
BoxProps.minHeight
minWidth?
readonlyoptionalminWidth:string|number
Sets a minimum width of the element.
Inherited from
BoxProps.minWidth
onContentHeightChange()?
optionalonContentHeightChange: (height,previousHeight) =>void
Callback fired when the total height of the content changes.
Parameters
height
number
The new total content height.
previousHeight
number
The previous total content height.
Returns
void
Remarks
Useful for debug logging or adjusting external layouts based on content size.
onItemHeightChange()?
optionalonItemHeightChange: (index,height,previousHeight) =>void
Callback fired when an individual child item’s height changes.
Parameters
index
number
The index of the item.
height
number
The new height of the item.
previousHeight
number
The previous height of the item.
Returns
void
Remarks
This is triggered whenever an item is re-measured and its height differs from the previous value.
onScroll()?
optionalonScroll: (scrollOffset) =>void
Callback fired when the scroll position changes.
Parameters
scrollOffset
number
The new scroll offset (distance from top).
Returns
void
Remarks
Use this to sync external state or UI (e.g., scrollbars) with the current scroll position.
onViewportSizeChange()?
optionalonViewportSizeChange: (size,previousSize) =>void
Callback fired when the ScrollView viewport (visible area) dimensions change.
Parameters
size
The new dimensions of the viewport (width, height).
height
number
width
number
previousSize
The previous dimensions of the viewport (width, height).
height
number
width
number
Returns
void
Remarks
Fired whenever the outer container size changes (e.g., terminal resize or layout update).
overflow?
readonlyoptionaloverflow:"visible"|"hidden"
Behavior for an element’s overflow in both directions.
Default
"visible";Inherited from
BoxProps.overflow
overflowX?
readonlyoptionaloverflowX:"visible"|"hidden"
Behavior for an element’s overflow in the horizontal direction.
Default
"visible";Inherited from
BoxProps.overflowX
overflowY?
readonlyoptionaloverflowY:"visible"|"hidden"
Behavior for an element’s overflow in the vertical direction.
Default
"visible";Inherited from
BoxProps.overflowY
padding?
readonlyoptionalpadding:number
Padding on all sides. Equivalent to setting paddingTop, paddingBottom, paddingLeft, and paddingRight.
Inherited from
BoxProps.padding
paddingBottom?
readonlyoptionalpaddingBottom:number
Bottom padding.
Inherited from
BoxProps.paddingBottom
paddingLeft?
readonlyoptionalpaddingLeft:number
Left padding.
Inherited from
BoxProps.paddingLeft
paddingRight?
readonlyoptionalpaddingRight:number
Right padding.
Inherited from
BoxProps.paddingRight
paddingTop?
readonlyoptionalpaddingTop:number
Top padding.
Inherited from
BoxProps.paddingTop
paddingX?
readonlyoptionalpaddingX:number
Horizontal padding. Equivalent to setting paddingLeft and paddingRight.
Inherited from
BoxProps.paddingX
paddingY?
readonlyoptionalpaddingY:number
Vertical padding. Equivalent to setting paddingTop and paddingBottom.
Inherited from
BoxProps.paddingY
position?
readonlyoptionalposition:"absolute"|"relative"
Inherited from
BoxProps.position
rowGap?
readonlyoptionalrowGap:number
Size of the gap between an element’s rows.
Inherited from
BoxProps.rowGap
width?
readonlyoptionalwidth:string|number
Width 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.
Inherited from
BoxProps.width