Placeholder
TsgcHTMLComponent_Placeholder — renderiza una tarjeta de carga esqueleto de Bootstrap 5 con una animación shimmer y líneas, imagen, título y botones configurables, en Delphi, C++ Builder y .NET.
TsgcHTMLComponent_Placeholder — renderiza una tarjeta de carga esqueleto de Bootstrap 5 con una animación shimmer y líneas, imagen, título y botones configurables, en Delphi, C++ Builder y .NET.
Un componente de cargador esqueleto que emite marcado placeholder de Bootstrap 5 con un shimmer glow o wave. Define el número de líneas y qué partes mostrar, y luego lee la propiedad HTML — o llama a los ayudantes estáticos BuildCard / BuildText.
TsgcHTMLComponent_Placeholder
Marcado de placeholder de Bootstrap 5
Delphi, C++ Builder, .NET
Llama a BuildCard(lineCount, animation) para una tarjeta esqueleto completa, o crea el componente, define LineCount, ShowImage y Animation, y luego lee HTML.
uses
sgcHTML_Enums, sgcHTML_Component_Placeholder;
// One-line static helper (primary form):
var
vHTML: string;
begin
vHTML := TsgcHTMLComponent_Placeholder.BuildCard(3, paWave);
WebModule.Response := vHTML;
end;
// Or configure it fully:
var
oPH: TsgcHTMLComponent_Placeholder;
begin
oPH := TsgcHTMLComponent_Placeholder.Create(nil);
try
oPH.LineCount := 4;
oPH.Animation := paGlow;
oPH.Color := hcSecondary;
oPH.ShowImage := True;
oPH.ShowTitle := True;
oPH.ShowButtons := True;
WebModule.Response := oPH.HTML; // Bootstrap placeholder card
finally
oPH.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Placeholder.hpp
// One-line static helper (primary form):
String html = TsgcHTMLComponent_Placeholder::BuildCard(3, paWave);
// Or configure it fully:
TsgcHTMLComponent_Placeholder *oPH = new TsgcHTMLComponent_Placeholder(NULL);
try
{
oPH->LineCount = 4;
oPH->Animation = paGlow;
oPH->Color = hcSecondary;
oPH->ShowImage = true;
oPH->ShowTitle = true;
oPH->ShowButtons = true;
String body = oPH->HTML; // Bootstrap placeholder card
}
__finally
{
delete oPH;
}
using esegece.sgcWebSockets;
// One-line static helper (primary form):
string html = TsgcHTMLComponent_Placeholder.BuildCard(3,
TsgcHTMLPlaceholderAnimation.paWave);
// Or configure it fully:
var ph = new TsgcHTMLComponent_Placeholder();
ph.LineCount = 4;
ph.Animation = TsgcHTMLPlaceholderAnimation.paGlow;
ph.Color = TsgcHTMLColor.hcSecondary;
ph.ShowImage = true;
ph.ShowTitle = true;
ph.ShowButtons = true;
string body = ph.HTML; // Bootstrap placeholder card
Los miembros que más vas a usar.
LineCount define cuántas líneas de texto de placeholder se renderizan (por defecto 3) con anchos variados para imitar texto real.
Animation selecciona el shimmer paGlow o paWave mediante TsgcHTMLPlaceholderAnimation.
ShowImage añade un bloque de imagen, ShowTitle una barra de título y ShowButtons dos placeholders de botón.
Size define la altura del placeholder con phSmall, phNormal, phLarge o phExtraLarge; Color toma un TsgcHTMLColor.
BuildCard(lineCount, animation) devuelve una tarjeta esqueleto completa; BuildText(lineCount, animation) solo líneas de texto; BuildButton(animation) un único botón.
HTML devuelve la tarjeta de placeholder completa de Bootstrap — cámbiala por el contenido real una vez que tus datos hayan cargado.