Card
Description
A card component with optional headers and footers
Cards are surfaces that display content and actions on a single topic.
They should be easy to scan for relevant and actionable information. Elements, like text and images, should be placed on them in a way that clearly indicates hierarchy.
Cards can contain different types of components. They can be used to show a list of items, a single item, or a mix of both.
API reference
public sealed class Card : ComponentBase<Card, HTMLElement>, IHasBackgroundColor, IRoundedStyleA bordered, shadowed surface used to group related content into a self-contained block.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<Card, HTMLElement> → Card
- Implements
- IHasBackgroundColor, IRoundedStyle
Constructors
| Name | Description |
|---|---|
| Card | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| IsCompact | Gets or set whenever the card is rendered in a compact form |
| Background | Gets or sets the CSS background of the component. |
public bool IsCompact { get ; set ; }Gets or set whenever the card is rendered in a compact form
Methods
| Name | Description |
|---|---|
| EnsureLayout | Gets or set whenever the card is rendered in a compact form |
| OnClick | Registers a callback invoked when the click event fires. |
| SetTitle | Sets the title of the component. |
| SetContent | Sets the content of the component. |
| SetFooter | Sets the footer of the component. |
| Compact | Renders the component in a compact form. |
| BackgroundColor | Sets the background colour of the card. |
| Border | Configures the component to border. |
| NoPadding | Removes / disables the padding on the component. |
| HoverColor | Enables or disables the hover colour overlay on the card. |
| Render | Renders the component's root HTML element. |
private void EnsureLayout()Gets or set whenever the card is rendered in a compact form
| Overload | |
|---|---|
| OnClick(ComponentEventHandler<Card, MouseEvent>, bool) | Registers a callback invoked when the click event fires. |
| OnClick(Action) | Registers a callback invoked when the click event fires. |
| Overload | |
|---|---|
| SetTitle(string) | Sets the title of the component. |
| SetTitle(IComponent) | Sets the title of the component. |
public Card BackgroundColor(string color)Sets the background colour of the card.
public Card Border(string color, UnitSize size = null)Configures the component to border.
public Card HoverColor(bool enabled = true)Enables or disables the hover colour overlay on the card.