Styles in EJ2 JavaScript Skeleton control

29 Aug 20232 minutes to read

You can customize skeleton control in the below ways.

cssClass

You can customize the style of a Skeleton control by using cssClass. The appearance of JavaScript Skeleton can be customized by changing the wave color, background color, width, and height. For detailed information, refer styles.css file below.

ej.base.enableRipple(true);

// Initialize Skeleton control
var circle = new ej.notifications.Skeleton({
    shape: 'Circle',
    width: "60px",
    cssClass: 'e-customize'
});

// Render initialized Skeleton.
circle.appendTo('#circleSkeleton');
<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 Skeleton</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript UI Controls">
    <meta name="author" content="Syncfusion">
    <link href="https://cdn.syncfusion.com/ej2/24.2.3/ej2-base/styles/material.css" rel="stylesheet">
    <link href="https://cdn.syncfusion.com/ej2/24.2.3/ej2-notifications/styles/material.css" rel="stylesheet">
    <link href="styles.css" rel="stylesheet">
    
    
<script src="https://cdn.syncfusion.com/ej2/24.2.3/dist/ej2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>

<body>
    
    <div id="container">
        <div style="position:relative;min-height:310px;border:1px solid; padding:20px;">
            <div id="circleSkeleton"></div>
        </div>
    </div>


<script>
var ele = document.getElementById('container');
if(ele) {
  ele.style.visibility = "visible";
}   
      </script>
<script src="index.js" type="text/javascript"></script>
</body></html>

Visible

You can use the visible property which defines the visible state of Skeleton.

// Initialize Skeleton control in hidden state
var circle: Skeleton = new ej.notifications.Skeleton({
    shape: 'Circle',
    width: "60px",
    visible: false
});

// Render initialized Skeleton
circle.appendTo('#circleSkeleton');