Skip to main content

Card

The Card widget is a surface with rounded corners and a shadow for depth, holding content together as one unit.
Use it to visually group related elements, such as list items or blocks of information.

Definition and role

The Card widget draws a rectangular surface that wraps a single child. Set its background color, shadow color, elevation, outline shape, and outer margin — it works as a container that holds the child.

  • Category: Layouts
  • Default child size: 100 × 100
  • Leave the background color unset and the surface draws as transparent.

Features

FeatureDescription
Content groupingGroups related elements onto a single surface so they read as one unit.
DepthElevation (elevation) and shadow color (shadowColor) make the card look like it floats above the background.
ShapeUse shape to set the outline border and corner rounding.
Background and marginAdjust the background color (color) and the margin outside the card (margin).
Overflow handlingclipBehavior decides how a child is clipped when it overflows the card's bounds.

How to use

  1. Open the Layouts category in the left widget palette.
  2. Drag and drop the Card item onto the canvas.
  3. Place the widgets you want to show inside the card as children.
  4. Adjust the background color, elevation, shape, margin, and more in the properties panel on the right.

Properties

PropertyDescriptionDefaultValue / type
colorCard background (surface) color. Draws as transparent when unset.Not setColor
shadowColorCard shadow colorNot setColor
elevationShadow depth (elevation)Not setNumber
shapeCard outline shape — border and cornersNot setShape value
borderOnForegroundWhether to draw the border over the child contenttruetrue / false
marginMargin outside the cardNot setMargin value
clipBehaviorHow a child is clipped when it overflows the card's boundsNot setnone, hardEdge, antiAlias, antiAliasWithSaveLayer
semanticContainerWhether accessibility treats the card as a single semantic containertruetrue / false

Notes and tips

tip

Control depth with elevation and shadowColor. The higher the value, the wider the shadow spreads and the more the card appears to float.

note

Leave color (the background color) unset and the card surface draws as transparent. Set a background color when you need a visible surface.

Learn more

tip

For the full set of Widget Controls (Property, Method, and Event) for scripting this widget, visit Card Widget Control.