Panel

TsgcHTMLComponent_Panel — render a Bootstrap card panel with header, body and footer, optionally collapsible and scrollable, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_Panel

A boxed content panel built on the Bootstrap card. Set the title and body, pick a color, toggle collapsible or scrollable, then read the HTML property.

Component class

TsgcHTMLComponent_Panel

Renders

Bootstrap 5 card markup

Languages

Delphi, C++ Builder, .NET

Create it, set content, render it

Assign Title, Body and Footer, choose a Color, then read HTML — or use the static one-line Build helper.

uses
  sgcHTML_Enums, sgcHTML_Component_Panel;

var
  oPanel: TsgcHTMLComponent_Panel;
begin
  oPanel := TsgcHTMLComponent_Panel.Create(nil);
  try
    oPanel.Title := 'Account Summary';
    oPanel.Body := '<p>Your plan renews on the 1st.</p>';
    oPanel.Footer := 'Last updated today';
    oPanel.Color := hcLight;
    oPanel.Collapsible := True;
    oPanel.Expanded := True;

    WebModule.Response := oPanel.HTML;   // Bootstrap card
  finally
    oPanel.Free;
  end;
end;

// Or in a single line with the static helper:
Result := TsgcHTMLComponent_Panel.Build('Account Summary',
  '<p>Your plan renews on the 1st.</p>', hcLight, 'Last updated today');
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Panel.hpp

TsgcHTMLComponent_Panel *oPanel = new TsgcHTMLComponent_Panel(NULL);
try
{
  oPanel->Title = "Account Summary";
  oPanel->Body = "<p>Your plan renews on the 1st.</p>";
  oPanel->Footer = "Last updated today";
  oPanel->Color = hcLight;
  oPanel->Collapsible = true;
  oPanel->Expanded = true;

  String html = oPanel->HTML;   // Bootstrap card
}
__finally
{
  delete oPanel;
}

// Or in a single line with the static helper:
String html = TsgcHTMLComponent_Panel::Build("Account Summary",
  "<p>Your plan renews on the 1st.</p>", hcLight, "Last updated today");
using esegece.sgcWebSockets;

var panel = new TsgcHTMLComponent_Panel();
panel.Title = "Account Summary";
panel.Body = "<p>Your plan renews on the 1st.</p>";
panel.Footer = "Last updated today";
panel.Color = TsgcHTMLColor.hcLight;
panel.Collapsible = true;
panel.Expanded = true;

string html = panel.HTML;   // Bootstrap card

// Or in a single line with the static helper:
string oneLine = TsgcHTMLComponent_Panel.Build("Account Summary",
    "<p>Your plan renews on the 1st.</p>", TsgcHTMLColor.hcLight, "Last updated today");

Key properties & methods

The members you reach for most often.

Content

Title sets the card header, Body the main HTML content and Footer an optional footer row.

Appearance

Color (TsgcHTMLColor) picks the theme color; Outline renders a bordered variant instead of a filled background.

Collapsing

Collapsible turns the header into a toggle, and Expanded sets whether the body starts open.

Scrolling

Scrollable with MaxHeight caps the body height and adds vertical scrolling for long content.

Identity

PanelID assigns the card an explicit DOM id, used as the anchor for the collapse target.

One-line build

Build(aTitle, aBody, aColor, aFooter) returns the panel HTML in a single static call; HTML renders a configured instance.

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.