Skip to content

Card

Card component is a content container used to display information in a structured format. It supports titles, subtitles, body text, icons, and interactive buttons, making it ideal for UI panels and information callouts in spatial environments.

Examples

Basic Card

The first example shows a basic card with a title, subtitle, and content. It uses the standard color theme and includes a "Close" and "Save" buttons.


Customized Style

This example demonstrates the outlined mode and the use of icons. The card uses a custom color. The component automatically calculates text contrast to ensure readability, by adjusting textcolor.


Card with Image

The final example showcases the image property and dark mode. When an image is provided, it is applied as a texture to the card background.

Props

PropertyTypeDefaultDescription
visiblebooleantrueControls the card's visibility. When true, the card is visible; when false, it is hidden.
positionnumber[]0 0 0Specifies the card's position.
opacitynumber1Specifies the opacity of the component.
modestring (light, dark)""Specifies the color scheme of the card, supporting either a light or dark theme.
colorstring (blue, #fff)#00BA92Defines the primary color of the card, affecting elements such as text and background.
textcolorstringblackSpecifies the color of the card's text. If the contrast with the background is insufficient, the text color will not be applied.
titlestring“Card Title”Sets the card's title text.
subtitlestring“Subtitle”Sets the card's subtitle text.
contentstring"This is an example of the basic card component."Sets the card's main text.
prependiconstring""Defines the icon to be displayed within the card. If set, the icon appears before the card’s title.
appendiconstring""Defines the icon to be displayed in upper right corner of the card.
buttonsarray[{ label: "Close", action: "close" }]Defines the action buttons displayed at the bottom of the card. Supports up to two buttons. Buttons emit a cardAction event containing their action string.
outlinedbooleanfalseWhen enabled, the card is displayed with an outline instead of a solid background.
imagestring""Applies a specific background image to the card.