Skip to main content

BnActivityIndicator

Namespace: BlazorNative.Components

An indeterminate spinner. Renders as an indeterminate ProgressBar on Android and a UIActivityIndicatorView on iOS.

public sealed class BnActivityIndicator : BnLayoutItem, Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleEvent, Microsoft.AspNetCore.Components.IHandleAfterRender

Inheritance ObjectComponentBaseBnLayoutItemBnActivityIndicator
Implements IComponent, IHandleEvent, IHandleAfterRender

Remarks:

It has no control parameters, including no start/stop. It animates for as long as it is mounted, so you control it with @if — render it while you are loading and unmount it when you are done. There is no hidden state to get wrong.

Its size is the platform's own by default, but you can override it. Leave BnLayoutItem.Width and BnLayoutItem.Height unset and it measures itself, the same as always. Set both and the box is exactly those numbers instead. The rest of the shared item surface (BnLayoutItem.Margin, BnLayoutItem.AlignSelf, BnLayoutItem.Grow, BnLayoutItem.Shrink, BnLayoutItem.Basis, BnLayoutItem.Position) works exactly as it does on any other component. Put it in a BnView if you need to place or pad it some other way.

@if (_loading)
{
<BnActivityIndicator />
}

Properties

BackgroundColor

Fill colour behind the component. Null leaves it transparent.

public string? BackgroundColor { get; set; }

Property Value

String

Margin

Space outside the component, between it and its siblings. Null = none.

public BnAutoLength? Margin { get; set; }

Property Value

BnAutoLength?

Remarks:

auto is legal here and absorbs free space, which re-centres the node.

AlignSelf

Cross-axis alignment for this item alone, overriding the parent's. Null = inherit.

public FlexAlign? AlignSelf { get; set; }

Property Value

FlexAlign?

Grow

Share of leftover space this item takes (unitless ratio). Null = Yoga's default (0).

public float? Grow { get; set; }

Property Value

Single?

Shrink

Share of overflow this item gives up (unitless ratio). Null = Yoga's default (1).

public float? Shrink { get; set; }

Property Value

Single?

Basis

Starting main-axis size before grow/shrink. Null = auto.

public BnAutoLength? Basis { get; set; }

Property Value

BnAutoLength?

Width

Box width. Null = auto.

public BnAutoLength? Width { get; set; }

Property Value

BnAutoLength?

Height

Box height. Null = auto.

public BnAutoLength? Height { get; set; }

Property Value

BnAutoLength?

MinWidth

Lower bound on width. Null = unset.

public BnLength? MinWidth { get; set; }

Property Value

BnLength?

MaxWidth

Upper bound on width. Null = unset.

public BnLength? MaxWidth { get; set; }

Property Value

BnLength?

MinHeight

Lower bound on height. Null = unset.

public BnLength? MinHeight { get; set; }

Property Value

BnLength?

MaxHeight

Upper bound on height. Null = unset.

public BnLength? MaxHeight { get; set; }

Property Value

BnLength?

Position

Positioning scheme. Null = Yoga's default (relative).

public FlexPosition? Position { get; set; }

Property Value

FlexPosition?

Top

Top inset. Null = unset.

public BnLength? Top { get; set; }

Property Value

BnLength?

Right inset. Null = unset.

public BnLength? Right { get; set; }

Property Value

BnLength?

Bottom

Bottom inset. Null = unset.

public BnLength? Bottom { get; set; }

Property Value

BnLength?

Left

Left inset. Null = unset.

public BnLength? Left { get; set; }

Property Value

BnLength?

Constructors

BnActivityIndicator()

public BnActivityIndicator()