Placeholder

TsgcHTMLComponent_Placeholder — Delphi、C++ Builder、.NET で、シマーアニメーションと設定可能な行、画像、タイトル、ボタンを備えた Bootstrap 5 スケルトン読み込みカードをレンダリングします。

TsgcHTMLComponent_Placeholder

グローまたはウェーブのシマー付きで Bootstrap 5 の placeholder マークアップを出力するスケルトンローダーコンポーネントです。行数と表示する部分を設定してから、HTML プロパティを読み取ります — または、静的な BuildCard / BuildText ヘルパーを呼び出します。

コンポーネントクラス

TsgcHTMLComponent_Placeholder

レンダリング内容

Bootstrap 5 の placeholder マークアップ

言語

Delphi, C++ Builder, .NET

一行で構築するか、完全に設定する

完全なスケルトンカードには BuildCard(lineCount, animation) を呼び出すか、コンポーネントを作成して LineCountShowImageAnimation を設定してから、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

主なプロパティとメソッド

最もよく使うメンバーです。

Lines

LineCount は、レンダリングするプレースホルダーテキストの行数(既定値 3)を、実際の文章を模倣するためにさまざまな幅で設定します。

Animation

Animation は、TsgcHTMLPlaceholderAnimation を介して paGlow または paWave のシマーを選択します。

Sections

ShowImage は画像ブロックを、ShowTitle はタイトルバーを、ShowButtons は 2 つのボタンプレースホルダーを追加します。

Appearance

Size は、phSmallphNormalphLargephExtraLarge でプレースホルダーの高さを設定します。ColorTsgcHTMLColor を取ります。

Static helpers

BuildCard(lineCount, animation) は完全なスケルトンカードを返し、BuildText(lineCount, animation) はテキスト行のみを、BuildButton(animation) は単一のボタンを返します。

Output

HTML は完全な Bootstrap プレースホルダーカードを返します — データが読み込まれたら、実際のコンテンツに差し替えます。

さらに詳しく

すべての sgcHTML コンポーネント60 以上のコンポーネントの全機能マトリックスを閲覧できます。
無料体験版のダウンロード30 日間の体験版には 60.HTML デモプロジェクトが付属します。
価格完全なソースコード付きの Single、Team、Site ライセンス。

始める準備はできましたか?

無料体験版をダウンロードして、Delphi、C++ Builder、.NET で Web UI の構築を始めましょう。