Scroll container
A layout container that scrolls its content horizontally and/or vertically.
No Overflow of its own: the two scroll modes say what it clips.
new ScrollContainerComponent("scroll-container")
Properties
| Property | Type | Default | Binding | Description |
|---|---|---|---|---|
| Own | ||||
HorizontalScrollSetHorizontalScroll · BindHorizontalScroll | UIScrollMode? | UIScrollMode.Disabled | one-way | Whether the viewport scrolls horizontally — Disabled, Auto, or Always; default Disabled. |
VerticalScrollSetVerticalScroll · BindVerticalScroll | UIScrollMode? | UIScrollMode.Auto | one-way | Whether the viewport scrolls vertically — Disabled, Auto, or Always; default Auto. |
ScrollSnapSetScrollSnap · BindScrollSnap | UIScrollSnapMode? | UIScrollSnapMode.Disabled | one-way | Whether a scroll comes to rest on a child's edge rather than wherever it was let go. |
ScrollAnchorSetScrollAnchor · BindScrollAnchor | UIScrollAnchor? | UIScrollAnchor.None | one-way | How the viewport reacts when its content grows, applying to the component's own scrolling element so it also works for a windowed host that a wrapping ScrollContainer could not reach. |
| From ContainerComponentBase | ||||
BackgroundSetBackground · BindBackground | UIThemeColor? | null | one-way | The surface's background colour; unset leaves whatever the theme paints underneath. |
PaddingSetPadding · BindPadding | UIResponsive<UIThickness>? | null | one-way | The inner spacing between this component's edges and its content, optionally overridden per breakpoint. |
BackgroundImageSetBackgroundImage · BindBackgroundImage | string | null | one-way | The picture painted over the background colour, centred and never repeated: a URL or a data URI. |
BackgroundImageFitSetBackgroundImageFit · BindBackgroundImageFit | UIImageFit? | UIImageFit.Cover | one-way | How the picture fills the surface. |
BorderColorSetBorderColor · BindBorderColor | UIThemeColor? | null | one-way | The border's colour, written as CSS border-color; unset leaves the stylesheet's own. |
BorderThicknessSetBorderThickness · BindBorderThickness | UIThickness? | null | one-way | The border's thickness, written as CSS border-width; unset leaves the stylesheet's own. |
BorderRadiusSetBorderRadius · BindBorderRadius | UICornerRadius? | null | one-way | The corner rounding, written as CSS border-radius; unset leaves the stylesheet's own. |
Methods
AnchorToEnd()- Follows content appended at the end while the viewer is already at the end.
DisableScroll()- Disables both horizontal and vertical scrolling.
VerticalScrollOnly()- Enables vertical scrolling only.
HorizontalScrollOnly()- Enables horizontal scrolling only.
BothScroll()- Enables both horizontal and vertical scrolling.
SetScroll(UIScrollMode horizontalScroll, UIScrollMode verticalScroll)- Sets the horizontal and vertical scroll behaviors.
AddChild(IVisualComponent child)- Adds a child component.
AddChildren(params IVisualComponent[] children)- Adds child components.
AddChildren(IEnumerable<IVisualComponent> children)- Adds child components.
Common properties (16) — layout, visibility, theme, and the rest every component shares
| Property | Type | Default | Binding | Description |
|---|---|---|---|---|
VisibilitySetVisibility · BindVisibility | UIResponsive<UIVisibility>? | Visible | one-way | What the component does with the room it was given, optionally overridden per breakpoint (e.g. collapsed from a given width up). |
EnabledSetEnabled · BindEnabled | bool? | true | one-way | Whether the component responds to input; false dims it and marks it, and its subtree, inert. |
ThemeSetTheme · BindTheme | UIThemeMode? | null | one-way | The theme mode forced on this component's subtree, or null to inherit the ambient theme. |
HorizontalAlignmentSetHorizontalAlignment · BindHorizontalAlignment | UIAlignment? | UIAlignment.Stretch | one-way | Where the component sits within its grid cell along the horizontal axis. |
VerticalAlignmentSetVerticalAlignment · BindVerticalAlignment | UIAlignment? | UIAlignment.Stretch | one-way | Where the component sits within its grid cell along the vertical axis. |
WidthSetWidth · BindWidth | UIResponsive<UILayoutLength>? | null | one-way | The component width, optionally overridden per breakpoint. |
MinWidthSetMinWidth · BindMinWidth | UIResponsive<UILayoutLength>? | null | one-way | The component minimum width, optionally overridden per breakpoint. |
MaxWidthSetMaxWidth · BindMaxWidth | UIResponsive<UILayoutLength>? | null | one-way | The component maximum width, optionally overridden per breakpoint. |
HeightSetHeight · BindHeight | UIResponsive<UILayoutLength>? | null | one-way | The component height, optionally overridden per breakpoint. |
MinHeightSetMinHeight · BindMinHeight | UIResponsive<UILayoutLength>? | null | one-way | The component minimum height, optionally overridden per breakpoint. |
MaxHeightSetMaxHeight · BindMaxHeight | UIResponsive<UILayoutLength>? | null | one-way | The component maximum height, optionally overridden per breakpoint. |
ZIndexSetZIndex · BindZIndex | int? | 0 | one-way | The stacking order within the visual tree. |
MarginSetMargin · BindMargin | UIResponsive<UIThickness>? | null | one-way | The outer spacing around the component, optionally overridden per breakpoint. |
PlacementSetPlacement · BindPlacement | UIResponsive<UIGridPlacement>? | null | one-way | The grid placement, optionally overridden per breakpoint. |
LoadingSetLoading · BindLoading | bool? | false | one-way | Whether the component is in loading state — a live state a controller turns on and off. |
ShowContextMenuSetShowContextMenu · BindShowContextMenu | bool? | true | one-way | Whether a right-click opens the IVisualComponent.ContextMenu; on a host with rows, whether it opens any row's. Off, the menu stays in the tree and nothing opens it. |