Spinner
TsgcHTMLComponent_Spinner — render a Bootstrap 5 loading spinner in border or grow style, with size, color and accessible text, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_Spinner — render a Bootstrap 5 loading spinner in border or grow style, with size, color and accessible text, in Delphi, C++ Builder and .NET.
A loading-spinner component that emits Bootstrap 5 spinner markup. Pick the spinner type, size and color, then read the HTML property — or call the static Build helper for a one-liner.
TsgcHTMLComponent_Spinner
Bootstrap 5 spinner markup
Delphi, C++ Builder, .NET
Call Build(spinnerType, color, size) for a quick spinner, or create the component, set SpinnerType, Size and ColorStyle, then read HTML.
uses
sgcHTML_Enums, sgcHTML_Component_Spinner;
// One-line static helper (primary form):
var
vHTML: string;
begin
vHTML := TsgcHTMLComponent_Spinner.Build(spBorder, hcPrimary, ssNormal);
WebModule.Response := vHTML;
end;
// Or configure it fully:
var
oSpin: TsgcHTMLComponent_Spinner;
begin
oSpin := TsgcHTMLComponent_Spinner.Create(nil);
try
oSpin.SpinnerType := spGrow;
oSpin.Size := ssSmall;
oSpin.ColorStyle := hcSuccess;
oSpin.Text := 'Loading...';
oSpin.SpinnerID := 'loader';
WebModule.Response := oSpin.HTML; // Bootstrap spinner markup
finally
oSpin.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Spinner.hpp
// One-line static helper (primary form):
String html = TsgcHTMLComponent_Spinner::Build(spBorder, hcPrimary, ssNormal);
// Or configure it fully:
TsgcHTMLComponent_Spinner *oSpin = new TsgcHTMLComponent_Spinner(NULL);
try
{
oSpin->SpinnerType = spGrow;
oSpin->Size = ssSmall;
oSpin->ColorStyle = hcSuccess;
oSpin->Text = "Loading...";
oSpin->SpinnerID = "loader";
String body = oSpin->HTML; // Bootstrap spinner markup
}
__finally
{
delete oSpin;
}
using esegece.sgcWebSockets;
// One-line static helper (primary form):
string html = TsgcHTMLComponent_Spinner.Build(TsgcHTMLSpinnerType.spBorder,
TsgcHTMLColor.hcPrimary, TsgcHTMLSpinnerSize.ssNormal);
// Or configure it fully:
var spin = new TsgcHTMLComponent_Spinner();
spin.SpinnerType = TsgcHTMLSpinnerType.spGrow;
spin.Size = TsgcHTMLSpinnerSize.ssSmall;
spin.ColorStyle = TsgcHTMLColor.hcSuccess;
spin.Text = "Loading...";
spin.SpinnerID = "loader";
string body = spin.HTML; // Bootstrap spinner markup
The members you reach for most often.
SpinnerType selects spBorder (rotating ring) or spGrow (pulsing dot) via TsgcHTMLSpinnerType.
Size chooses ssNormal or ssSmall via TsgcHTMLSpinnerSize.
ColorStyle takes a TsgcHTMLColor (such as hcPrimary or hcSuccess); Color accepts a raw Bootstrap color name string.
Text sets the visually hidden status label read by screen readers (defaults to the locale's "Loading..." text).
SpinnerID assigns the element id so you can show or remove the spinner from JavaScript.
Build(spinnerType, color, size) returns a ready spinner; HTML emits the Bootstrap spinner markup with its role and hidden text.