NE.Standard

Collapsible panel

A panel that folds away toward one edge and back, with a switch of its own.

CollapsiblePanelComponent · type key standard.collapsible-panel · Layouts · property blocks: ISurfaceComponent, IBorderedComponent, ICollapsibleComponent

Collapsed, it shows only the switch. Place it in a track that can give the room back (UIGridUnit.Auto); a fixed track won't shrink with the panel.

new CollapsiblePanelComponent("collapsible-panel")

Properties

PropertyTypeDefaultBindingDescription
Background
SetBackground · BindBackground
UIThemeColor?nullone-wayThe surface's background colour; unset leaves whatever the theme paints underneath.
Padding
SetPadding · BindPadding
UIResponsive<UIThickness>?nullone-wayThe inner spacing between this component's edges and its content, optionally overridden per breakpoint.
BackgroundImage
SetBackgroundImage · BindBackgroundImage
stringnullone-wayThe picture painted over the background colour, centred and never repeated: a URL or a data URI.
BackgroundImageFit
SetBackgroundImageFit · BindBackgroundImageFit
UIImageFit?UIImageFit.Coverone-wayHow the picture fills the surface.
BackgroundImageDim
SetBackgroundImageDim · BindBackgroundImageDim
double?nullone-wayHow far the picture is dimmed, from 0 (not at all) to 1 (gone): the ground the content reads on, laid over it — darker in a dark theme, lighter in a light one. Drawn by the browser; unset, the picture is not dimmed.
BackgroundImageDimMode
SetBackgroundImageDimMode · BindBackgroundImageDimMode
UIBackgroundDimMode?UIBackgroundDimMode.Uniformone-wayHow ISurfaceComponent.BackgroundImageDim is spread over the picture: evenly, or at the edges alone.
BackgroundImageBlur
SetBackgroundImageBlur · BindBackgroundImageBlur
double?nullone-wayThe blur of the picture, in the platform's device-independent units, zero or more; the content over it stays sharp. Drawn by the browser; unset, the picture is not blurred.
BorderColor
SetBorderColor · BindBorderColor
UIThemeColor?nullone-wayThe border's colour, written as CSS border-color; unset leaves the stylesheet's own.
BorderThickness
SetBorderThickness · BindBorderThickness
UIResponsive<UIThickness>?nullone-wayThe border's thickness, optionally overridden per breakpoint; unset leaves the stylesheet's own.
A frame on a wide screen may run edge to edge on a phone: SetBorderThickness(UIThickness.Uniform(0), md: UIThickness.Uniform(1)).
BorderRadius
SetBorderRadius · BindBorderRadius
UIResponsive<UICornerRadius>?nullone-wayThe corner rounding, optionally overridden per breakpoint; unset leaves the stylesheet's own.
Expanded
SetExpanded · BindExpanded
bool?trueone-wayWhether the component is unfolded (the authored start, or a bound value); the viewer's own fold stays client-side and may later disagree.
An expander's is two-way, the viewer's fold written back; a collapsible's fold stays the viewer's, client-side.
Side
SetSide
UISide?UISide.Left—The edge the component sits on and folds toward, which decides whether width or height collapses.
ShowCollapseToggle
SetShowCollapseToggle
bool?true—Whether the component draws its own switch for ICollapsibleComponent.Expanded.

Events

OnExpand(string command)
Registers a command to invoke when the component is expanded.
OnExpand(string command, params KeyValuePair<string, UIActionArgument>[] arguments)
Registers a command with bound arguments to invoke when the component is expanded.
OnExpandLiteral(string command, params KeyValuePair<string, object>[] arguments)
Registers a command with literal arguments to invoke when the component is expanded.
OnCollapse(string command)
Registers a command to invoke when the component is collapsed.
OnCollapse(string command, params KeyValuePair<string, UIActionArgument>[] arguments)
Registers a command with bound arguments to invoke when the component is collapsed.
OnCollapseLiteral(string command, params KeyValuePair<string, object>[] arguments)
Registers a command with literal arguments to invoke when the component is collapsed.

Methods

SetContent(IVisualComponent content)
Sets the content region.
SetToggleContent(IVisualComponent content)
Puts content beside the panel's switch, in one row with it — a title, a search, a button of the panel's own — seen only while the panel is open.
SetCollapsed()
Sets IExpandableComponent.Expanded to false.
ConfigureTemplate(TTemplate? current, Action<TTemplate> configure, string what)
Configures current when it is a TTemplate, throwing when a different one was set.
Common properties (23) — layout, visibility, theme, and the rest every component shares
PropertyTypeDefaultBindingDescription
Visibility
SetVisibility · BindVisibility
UIResponsive<UIVisibility>?Visibleone-wayWhat the component does with the room it was given, optionally overridden per breakpoint (e.g. collapsed from a given width up).
Hidden at every width — by a static value or a controller binding — the server refuses a command or a value the component or anything inside it sends. That is a guard against a stale or forged page, not the permission itself: an interaction that hides it (HiddenWhen) lives on the client alone, so who may act belongs in the command or the setter.
Enabled
SetEnabled · BindEnabled
bool?trueone-wayWhether the component responds to input; false dims it and marks it, and its subtree, inert.
False by a static value or a controller binding, the server refuses a command or a value the component or anything inside it sends. That is a guard against a stale or forged page, not the permission itself: an interaction that disables it (EnabledWhen) lives on the client alone, so who may act belongs in the command or the setter.
Theme
SetTheme · BindTheme
UIThemeMode?nullone-wayThe theme mode forced on this component's subtree, or null to inherit the ambient theme.
HorizontalAlignment
SetHorizontalAlignment · BindHorizontalAlignment
UIResponsive<UIAlignment>?Stretchone-wayWhere the component sits within its grid cell along the horizontal axis, optionally overridden per breakpoint.
VerticalAlignment
SetVerticalAlignment · BindVerticalAlignment
UIResponsive<UIAlignment>?Stretchone-wayWhere the component sits within its grid cell along the vertical axis, optionally overridden per breakpoint.
Width
SetWidth · BindWidth
UIResponsive<UILayoutLength>?nullone-wayThe component width, optionally overridden per breakpoint.
MinWidth
SetMinWidth · BindMinWidth
UIResponsive<UILayoutLength>?nullone-wayThe component minimum width, optionally overridden per breakpoint.
MaxWidth
SetMaxWidth · BindMaxWidth
UIResponsive<UILayoutLength>?nullone-wayThe component maximum width, optionally overridden per breakpoint.
Height
SetHeight · BindHeight
UIResponsive<UILayoutLength>?nullone-wayThe component height, optionally overridden per breakpoint.
MinHeight
SetMinHeight · BindMinHeight
UIResponsive<UILayoutLength>?nullone-wayThe component minimum height, optionally overridden per breakpoint.
MaxHeight
SetMaxHeight · BindMaxHeight
UIResponsive<UILayoutLength>?nullone-wayThe component maximum height, optionally overridden per breakpoint.
ZIndex
SetZIndex · BindZIndex
int?0one-wayThe stacking order within the visual tree.
Margin
SetMargin · BindMargin
UIResponsive<UIThickness>?nullone-wayThe outer spacing around the component, optionally overridden per breakpoint.
Placement
SetPlacement · BindPlacement
UIResponsive<UIGridPlacement>?nullone-wayThe grid placement, optionally overridden per breakpoint.
AlignWithFieldBoxes
SetAlignWithFieldBoxes
UIResponsive<UIFieldBoxAlignment>?null—Whether the component stands level with the boxes of captioned fields beside it — a caption line down, centred on the box — and on which boxes, per breakpoint. Unset, the compiler decides it wherever the component stands side by side with a thing that draws a caption row (UIFieldBoxes); UIFieldBoxAlignment.None keeps it where it is laid out.
Render-time only. A panel draws it as its top padding and its least height, anything else as its top margin, set down onto the band's middle; an authored Padding, MinHeight or Margin replaces them.
Loading
SetLoading · BindLoading
bool?falseone-wayWhether the component is in loading state — a live state a controller turns on and off.
While it holds, by a static value or a controller binding, the server refuses a command or a value the component or anything inside it sends — as the page does.
LoadingStyle
SetLoadingStyle · BindLoadingStyle
UILoadingStyle?nullone-wayThe visual indicator shown while this component or spinner is loading, or null to inherit the ambient or theme loading style.
ShowContextMenu
SetShowContextMenu · BindShowContextMenu
bool?trueone-wayWhether 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.
ActionBar
SetActionBar
UIActionBarAlignment?null—How the component's action bar lines up with it, or null for none: the IVisualComponent.ContextMenu's entries marked for the bar (a menu item's InActionBar) as icons, and "more" opening the menu itself, floating above the component once the reader chooses it — a press, a tap, the keyboard's cursor — until a press elsewhere, Escape, or another chosen.
A quick view of the menu, not a second list: a press on an icon is that entry's press. Render-time only; a component with an action bar and no context menu is refused when the view compiles.
ActionBarRepeatInMore
SetActionBarRepeatInMore
bool?true—Whether the menu the IVisualComponent.ActionBar's "more" opens repeats the entries the bar shows (the default), or holds the rest alone — no caption or rule left with nothing to stand over or between. A right-click and a long press open the whole menu either way, and a bar whose menu holds nothing more draws no "more".
Render-time only.
ScrollGroup
SetScrollGroup · BindScrollGroup
stringnullone-wayThe scroll group this component belongs to: every component sharing the name scrolls together.
Driven by whichever one the reader scrolls. Components that mark their shown source lines (e.g. a code field and a Markdown display) sync line-for-line; otherwise by scroll fraction.
TextSelectable
SetTextSelectable · BindTextSelectable
bool?nullone-wayWhether the reader can select the words in this component and everything inside it: true lets them (a table whose cells are copied, a chat bubble), false keeps them out; unset, the place decides — a Text's and a Paragraph's words and a validation message select, unless they stand in a row, a menu or another control, and nothing else does. The nearest component that says wins.
A control's own words (a button's label, a tab, a menu entry, a field's caption), a surface the pointer drags (a row that drags by itself, a canvas, a grip) and, on a touch screen, anything a long press opens a menu on never select; a field's value always does.
WindowFoot
SetWindowFoot
bool?null—Whether this component is the window's foot (a chat's composer, a pane's last row): where it stands at the window's bottom edge the phone's system bar takes its background colour, dimmed by any open modal drawer or dialog veil, and its content sits above the bar. The page's bottom bar is one by itself.
Render-time only.