Documentation
On this page

Component · Components

ScrollViewer

Scrollable single-child viewport.

@sharpts/gui 0.0.0-local · SharpTS 7c6010104a43

Signature

TypeScript
ScrollViewer(props: ScrollViewerProps): GuiElement

Parameters

NameTypeDescription
propsScrollViewerPropsScrollable single-child viewport.

Returns

GuiElement — Scrollable single-child viewport.

Control metadata

Props

NameTypeDescription
refControlRef<THandle>Receives the retained native control handle.
widthnumberPreferred control width in device-independent pixels.
Default: "NaN"
heightnumberPreferred control height in device-independent pixels.
Default: "NaN"
minWidthnumberMinimum permitted control width.
Default: 0
minHeightnumberMinimum permitted control height.
Default: 0
maxWidthnumberMaximum permitted control width.
Default: "Infinity"
maxHeightnumberMaximum permitted control height.
Default: "Infinity"
marginThicknessSpace outside the control.
Default: 0
horizontalAlignmentHorizontalAlignmentHorizontal alignment within the parent layout slot.
Default: "stretch"
Values: "left", "center", "right", "stretch"
verticalAlignmentVerticalAlignmentVertical alignment within the parent layout slot.
Default: "stretch"
Values: "top", "center", "bottom", "stretch"
isVisiblebooleanWhether the control participates in rendering and layout.
Default: true
isEnabledbooleanWhether the control accepts user interaction.
Default: true
opacitynumberOpacity from zero (transparent) to one (opaque).
Default: 1
toolTipstringText shown when the pointer pauses over the control.
automationNamestringAccessible automation name exposed to assistive technology and test drivers.
classesreadonly string[]Avalonia style classes applied to the native control.
canvasLeftnumberCanvas left coordinate when parented by Canvas.
Default: "NaN"
canvasTopnumberCanvas top coordinate when parented by Canvas.
Default: "NaN"
gridRownumberZero-based row index when the control is placed in a Grid.
Default: 0
gridColumnnumberZero-based column index when the control is placed in a Grid.
Default: 0
gridRowSpannumberNumber of Grid rows occupied by the control.
Default: 1
gridColumnSpannumberNumber of Grid columns occupied by the control.
Default: 1
dockDockEdge used when the control is placed in a DockPanel.
Default: "left"
Values: "left", "top", "right", "bottom"
onKeyDown(event: KeyEvent) => booleanHandles a normalized key-down event.
onKeyUp(event: KeyEvent) => booleanHandles a normalized key-up event.
capturePointerOnPressbooleanCaptures a pressed pointer until release, cancellation, unmount, or disposal.
Default: false
onPointerDown(event: PointerEvent) => booleanHandles a normalized pointer press.
onPointerMove(event: PointerEvent) => booleanHandles normalized pointer movement.
onPointerUp(event: PointerEvent) => booleanHandles a normalized pointer release.
onPointerCancel(event: PointerEvent) => booleanHandles cancellation or loss of an active pointer capture using its last known local state.
allowDropbooleanAllows native drag data to be dropped on this control.
Default: false
onDragOver(event: DropEvent) => DropEffectChooses the accepted native drag effect.
onDrop(event: DropEvent) => void | Promise<unknown>Receives normalized text and local-file drop data.
horizontalScrollBarVisibilityScrollBarVisibilityVisibility policy for the horizontal scroll bar.
Default: "auto"
Values: "auto", "visible", "hidden", "disabled"
verticalScrollBarVisibilityScrollBarVisibilityVisibility policy for the vertical scroll bar.
Default: "auto"
Values: "auto", "visible", "hidden", "disabled"

Source

SharpTS.Gui.Sdk/GuiPackage/control-surface.generated.ts:397 at SharpTS revision 7c6010104a43c34d80e9d44704cf179bc4f5b8e0.