Card()

Creates a Material Design card container. Cards are used to group related content and actions.

Syntax
Result = MaterialSB::Card(Text.s = "", Flags = #Card_Default, Parent = #Null)
Parameters
Parameter Description
Text.s (Optional) Initial HTML content for the card. Only useful with #Card_Panel.
Flags (Optional) Card style flags. Can be combined with |.
Parent (Optional) Parent element. Uses current parent if #Null.
Flags
Flag Description
#Card_Default Standard card with structured sections.
#Card_Panel Simple panel without internal structure. Good for plain content.
#Card_Small Fixed small height (300px).
#Card_Medium Fixed medium height (400px).
#Card_Large Fixed large height (500px).
#Card_Horizontal Horizontal layout with image on the side.
Return Value

Returns the card DOM element. This element is pushed onto the parent stack.

Remarks

Card() pushes to the parent stack. Call CloseCurrentParent() when finished adding content.

For structured cards, use these child functions:

Example
; Simple panel card
MaterialSB::Card("This is a simple card panel", MaterialSB::#Card_Panel)
MaterialSB::CloseCurrentParent()

; Structured card with content and actions
MaterialSB::Card()
  MaterialSB::CardContent()
    MaterialSB::CardTitle("Card Title")
    MaterialSB::Append(MaterialSB::Paragraph("Card content goes here."))
  MaterialSB::CloseCurrentParent()
  MaterialSB::CardAction()
    MaterialSB::Append(MaterialSB::Link("Action 1", @Action1()))
    MaterialSB::Append(MaterialSB::Link("Action 2", @Action2()))
  MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()

; Card with image
MaterialSB::Card()
  MaterialSB::CardImage("image.jpg")
  MaterialSB::CardContent()
    MaterialSB::CardTitle("Image Card")
    MaterialSB::Append(MaterialSB::Paragraph("A card with an image."))
  MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()
See Also

CardImage(), CardContent(), CardTitle(), CardAction(), CloseCurrentParent()