Card
Card widget is a universal wrapper for displaying content in the form of cards with support for two modes: tab (tabs) and plain (plain).
Demo
Tab View Demo
This looks great! I really like the new design direction we're taking.
I agree! The color scheme works really well.
Should we consider accessibility implications?
Could we explore some alternative layouts? I have a few ideas that might work better for mobile users.
The performance improvements are impressive. Load times have decreased by 40%!
That's amazing! What optimizations did you implement?
Name | Іван Петренко |
Email | |
Role | Administrator |
Department | IT Department |
Phone | +380 44 123 4567 |
Plain View Demo
Description
Name | Іван Петренко |
Email | |
Role | Administrator |
Department | IT Department |
Phone | +380 44 123 4567 |
History
This looks great! I really like the new design direction we're taking.
I agree! The color scheme works really well.
Should we consider accessibility implications?
Could we explore some alternative layouts? I have a few ideas that might work better for mobile users.
The performance improvements are impressive. Load times have decreased by 40%!
That's amazing! What optimizations did you implement?
Usage
Basic usage
// Plain view
<Card :panels="panelsData" view="plain">
<template #panel-0>
<Widget />
</template>
</Card>
// Tab view
<Card :data="tabsData" view="tab">
<template #tab-0>
<Widget />
</template>
</Card>
TypeScript interfaces
interface ICard {
panels?: ICardItem[];
data?: any;
view?: 'tab' | 'plain';
}
interface ICardItem {
name?: string;
label?: string;
component?: string;
slot?: string;
col?: number;
html?: string;
title?: string;
type?: string;
count?: number;
}
Data structure
Card widget can work with two types of data:
- Direct array of panels through the
panels
property - Complex structure through the
data
property with support fortype: "tabs"
// Example of data structure
[
{
"type": "tabs",
"col": 12,
"items": [
{
"name": "general_info",
"html": "HTML content",
"title": "General information"
},
{
"component": "vs-widget-gallery",
"title": "Gallery"
}
]
}
]
Properties
Card
Property | Type | Default | Description |
---|---|---|---|
panels | ICardItem[] | [] | Array of panels to display |
data | any | {} | Data for processing (supports structure with type: "tabs") |
view | 'tab' | 'plain' | 'plain' | Display mode |
CardItem
Property | Type | Default | Description |
---|---|---|---|
name | string | - | Unique name of the element |
label | string | - | Label of the element |
title | string | - | Title of the element |
component | string | - | Name of the component for rendering |
slot | string | - | Name of the slot |
col | number | 12 | Number of columns (1-12) |
html | string | - | HTML content for display |
Key features
- Tab View: Displays content in tabs with the ability to switch
- Plain View: Displays content in a grid of panels
- HTML support: You can pass HTML content through the
html
property - Components: Support for dynamic rendering of components
- Slots: Flexible system of slots for custom content
- Adaptability: Support for different column sizes (1-12)
- TypeScript: Full support for TypeScript with type checking