SimpleCard

Overview #

SimpleCard can be used to show your important KPI in dashboard. The card simply show the value with additional settings for icon to show with and color of card.

Sample Code #

<?php 
\koolreport\amazing\SimpleCard::create(array(
    "title"=>"Income",
    "value"=>7500,
    "cssClass"=>array(
        "icon"=>"fa fa-dollar"
    )
));
?>

Properties #

Nametypedefaultdescription
titlestringThe title of the card
valuenumberThe value that you need to show
formatarrayContain settings for formatting the value
presetstring"primary"The preset appearance for card, accept "primary", "info", "warning", "danger"
cssClassarrayContain settings for css class
cssStylearrayContain settings for css style

Format #

There are number of settings to format the value of card:

SimpleCard::create(array(
    ...
    "format"=>array(
        "value"=>array(
            "decimals"=>2,              // Number of decimals to show
            "decimalPoint"=>".",        // Decimal point character 
            "thounsandSeparator"=>",",  // Thousand separator
            "prefix"=>"$",              // Prefix
            "suffix"=>"USD"             // Suffix
        )
    )
))

cssClass #

There are number of sub settings for cssClass:

Nametypedefaultdescription
cardstringSet extra css class for card
titlestringSet css class for title
valuestringSet css class for value
iconstringSet css class for icon

Example:

SimpleCard::create(array(
    "cssClass"=>array(
        "card"=>"my-own-card-class",
        "tittle"=>"font-bold",
        "value"=>"big-font",
        "icon"=>"fa fa-dollar"
    )
));

Notice: The "icon" property can be used to set the icon using font-awesome or simpleline icon.

cssStyle #

Alternative to set the cssClass, you may directly set the css style to the card element:

Nametypedefaultdescription
cardstringCss style for card
titlestringCss style for card title
valuestringCss style for card value
iconstringCss style for card icon

Example:

SimpleCard::create(array(
    "cssStyle"=>array(
        "card"=>"background-color:yellow",
        "title"=>"font-weight:bold",
        "value"=>"font-style:italic",
        "icon"=>"font-size:24px;color:#333"
    )
));