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

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.

Component class

TsgcHTMLComponent_Spinner

Renders

Bootstrap 5 spinner markup

Languages

Delphi, C++ Builder, .NET

Build it in one line, or configure it fully

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

Key properties & methods

The members you reach for most often.

Type

SpinnerType selects spBorder (rotating ring) or spGrow (pulsing dot) via TsgcHTMLSpinnerType.

Size

Size chooses ssNormal or ssSmall via TsgcHTMLSpinnerSize.

Color

ColorStyle takes a TsgcHTMLColor (such as hcPrimary or hcSuccess); Color accepts a raw Bootstrap color name string.

Accessibility

Text sets the visually hidden status label read by screen readers (defaults to the locale's "Loading..." text).

Identity

SpinnerID assigns the element id so you can show or remove the spinner from JavaScript.

Static helper & output

Build(spinnerType, color, size) returns a ready spinner; HTML emits the Bootstrap spinner markup with its role and hidden text.

Keep exploring

All sgcHTML ComponentsBrowse the full feature matrix of 60+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.

Ready to Get Started?

Download the free trial and start building web UIs in Delphi, C++ Builder and .NET.