Card
Group related information and actions in one area.
Usage guide
#Contain one independent collection of information, such as a project or product. Use Layout or Flex for simple page arrangement.
- Title and tools
- Put the title in
cardTitleor theheaderslot, and secondary actions inheader-actions. - Body and footer
- Place content in the default slot and follow-up actions in
footer. - Cover image
- The cover slot is displayed only when
showCoveris also enabled.
Examples
#Feature examples
#Choose a feature from 4 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-card>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Allow the card content to be collapsed and expanded. | |
boolean | true | Whether the body is expanded. | |
boolean | false | Show the cover slot. | |
boolean | true | Show the footer slot. | |
boolean | false | Use the card backdrop effect. | |
boolean | false | Allow scrollbars in the content area. | |
boolean | false | Show the status icon. | |
string | '' | Set icon visibility or icon content. Check the format supported by each component. | |
string | 'Card Title' | Card title. | |
boolean | false | Legacy alias for `show-backdrop`. | |
number | 0 | Expansion delay in milliseconds. | |
number | 0 | Collapse delay in milliseconds. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<{ active: boolean }> | Read the result from the event's detail. |
Methods
| Method | Returns | Description |
|---|---|---|
Promise<void> | Toggle the current expansion state. | |
Promise<void> | Expand the body. | |
Promise<void> | Collapse the body. |
Slots
| Slot | Description |
|---|---|
| Content displayed in the cover area. | |
| Content displayed in the header area. | |
| Content displayed in the header-actions area. | |
| Component body or child items. | |
| Content displayed in the footer area. |