Card

Definition

<cst-card>
<sub-theme/>
<sub-font/>
<sub-style/>
<sub-access/>
<sub-header/>
<sub-body/>
<sub-options />
<sub-feature-flag/>
</cst-card>

OR

<cst-element name="card" schema="" schema-prop="" value=""/>

Example

<cst-card id="" value="">
<sub-theme name="" clr-var1="" clr-var2=""/>
<sub-font name="" font-var1="" font-var2=""/>
<sub-style name="" width="" height=""/>
<sub-access can-view="" can-modify=""/>
<sub-header text="" sub-text=""/>
<sub-body text=""/>
<sub-feature-flag>
</cst-card>

Attributes

AttributeValueDescription
idstring typeIdentifier for component.
classstring typeSpecifies class to be applied(Multiple classes can be given with space).

sub-theme

object typeSpecifies theme to be used for component.

sub-font

object typeSpecifies fonts to be used for component.

sub-style

object typeSpecifies style to be applied to component.

options

object typeSpecifies help icon to be displayed.

feature-flag

objectSpecifies what features to enable/disable.
otherany typeAny other info.
schemaobject type Specifies JSON schema.
schema-propstring typeSpecifies property to be used to pick schema.

Sub element attributes

sub-theme

PropertyValueDescription
nameprimary(default)/secondary/customName of the theme.
clr-labelstring typeIf custom then specific/ named color variables

sub-font

PropertyValueDescription
nameroboto (default)/customName of the font
font-textstring typeIf custom then specific/ named font variables.
font-labelstring type
font-errorstring type

sub-style

PropertyValueDescription
namematerial/skeuomorphicName of design to be used.
widthpercentage/pixels/string(x-small,small,medium,large,x-large)Gives width/any other prop value

options

PropertyValueDescription

feature-flag

PropertyValueDescription

Schema Examples

Full schema

Fetch appropriate based on schemaProp

let schema = {
type: "object",
properties: {
cardData: {
type: "object",
cstAttr: {
elementName: 'card',
raw:{ //loop & add to element
class:'outline cst-class1',
},
subHeader: {
text: '',
subText: ''
},
subBody: {
text: ''
},
subStyle:{
name: '',
width:'',
height:'',
fontSize:''
},
subOptions:{
},
subFeature: {
},
subTheme:{
name:'',
clrLabel:''
},
subFont:{
name:'',
fontText:'',
fontLabel:'',
fontError:''
}
},
cstElm: {
buttons: [
{
type: "string",
title:"Read",
value: 'Read',
cstAttr: {
elementName: 'button',
},
{
type: "string",
title:"Bookmark",
value: 'Bookmark',
cstAttr: {
elementName: 'button',
}
}
}],
icons: [
{
type: "string",
title:"Favorite",
cstAttr: {
elementName: 'icon',
}
},
{
type: "string",
title:"Share",
cstAttr: {
elementName: 'icon',
}
}
],
headerImage: { // picture element schema
src:''
}
}
}
}
}
let schemaProp = 'cardData';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;

Exact schema

let schema = {
type: "string",
cstAttr: {
}
}
let schemaProp = '';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;

Nested object

Nested object schemaProp

let schema = {};
let schemaProp = 'EMDDetails.cardData';
var finalSchema = schema;
let schemaPropSplits = schemaProp.split('.');
for(let prop of schemaPropSplits){
finalSchema = finalSchema.properties[schemaProp];
}

Material Measurement Guidelines

Spec_1
Spec_2
Spec_3
Spec_4

Events

AttributeDescription
onClickTriggered when card is clicked.
onHoverTriggered when card is hovered.

Event Method signature

method(parentRefObj, evtObj, elm, others)

Parameters description

ParameterValueDescription
parentRefObj
parentRefObj = {
parentContext,
loopParentContext,
doubleLoopParentContext
}
Parent Context references
evtObjobjectEvent object
elmobjectElement value
othersanyOther value

Over-ridable Classes

  • cst-ovr-card-elm
  • cst-ovr-card
  • cst-ovr-card-header
  • cst-ovr-card-header-text
  • cst-ovr-card-header-sub-text
  • cst-ovr-card-body
  • cst-ovr-card-footer

Unit test Screenshots

Responsiveness Test Screenshots

Design Images

Demo link

Points

  • Clickable card?
  • unit test screen shots
  • ui + responsive test screen shots
  • component demo link
  • bring designer's images in docs