Installation
To use SlateUI in your project, copy the CDN link and paste it in the head of the HTML file of your project. OR Can Import the File in your project by using the following command:
@import "https://slateui.netlify.app/css/components.css";
Import this code in CSS file : | |
@import url('https://agri-component.netlify.app/css/components.css'); | |
OR | |
Link this CSS file in HTML File : | |
<link rel="stylesheet" href="https://agri-component.netlify.app/css/components.css"/> |
Alerts are available in 5 types- success alert, error alert, warning alert, primary alert, secondary alert. To use this alert just use class name alert-box and also add class according to alert type- alert-primary, alert-secondary, alert-danger, alert-success, alert-warning. (e.g.class="alert-box alert-primary"). You can copy html part from below code snippet.
<!-- Primary Alerts Examples --> | |
<div class="alert primary-alert">A primary alert example with a text link. <span | |
class="link link-active">Check | |
it out</a><span> | |
</div> | |
<!-- Secondary Alerts Examples --> | |
<div class="alert secondary-alert">A secondary alert example.</div> | |
<!-- Success Alerts Examples --> | |
<div class="alert success-alert"><span class="alertmi material-icons">check_circle</span>A success | |
alert | |
example. | |
</div> | |
<!-- Danger Alerts Examples --> | |
<div class="alert danger-alert"><span class="alertmi material-icons">dangerous</span>A danger alert | |
example. | |
</div> | |
<!-- Warning Alerts Examples --> | |
<div class="alert warning-alert"><span class="alertmi material-icons">warning</span> A warning alert | |
example. | |
</div> | |
</div> |
Avatar is available in 4 different sizes. You can use image in Avatar. You need to include class avatar and for size add class according to size avatar-lg-size, avatar-md-size, avatar-sm-size, avatar-xs-size (e.g. class="avatar avatar-lg-size") Don't forget to add Responsive Image class names for img element. Example of Text Avatar You can use initial letters of user in Avatar as well. You need to include class avatar-text along with avatar and size class. (e.g. class="avatar avatar-lg-size avatar-text")
<div class="avatar"> | |
<div class="avatar lg-avatar-size"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /> </div> | |
<div class="avatar md-avatar-size"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /> </div> | |
<div class="avatar sm-avatar-size"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /> </div> | |
<div class="avatar xs-avatar-size"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /></div> | |
</div> | |
<div class="text-responsive"> | |
<div class="avatar lg-avatar-size text-round">PP</div> | |
<div class="avatar md-avatar-size text-round">PP</div> | |
<div class="avatar sm-avatar-size text-round">PP</div> | |
<div class="avatar xs-avatar-size text-round">PP</div> | |
</div> | |
</div> |
We have 2 types of status badges that can be integrated with Avatars. You can show colors to show the online status of user. And to show cart or notification count, you can use number badge. Check code below to copy the html part as is. We have multiple sizes of text-badges for using these you can use text-badge-large, text-badge-medium-large, text-badge-medium, text-badge-small, text-badge-medium-very-small classes.
<div class="badge-ui"> | |
<!-- large image with online badge --> | |
<div class="badge-ui lg-avatar-size badge-status"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /> | |
<span class=" badge lg-badge badge-online"></span> | |
</div> | |
<!-- medium image with offline badge --> | |
<div class="badge-ui md-avatar-size badge-status"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /> | |
<span class=" badge md-badge badge-offline"></span> | |
</div> | |
<!-- small image with ready badge --> | |
<div class="badge-ui sm-avatar-size badge-status"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /> | |
<span class=" badge sm-badge badge-away"></span> | |
</div> | |
<!-- extra small image with blue badge --> | |
<div class="badge-ui xs-avatar-size badge-status"> <img src="/images/scorpio-sign.jpg" alt="avatar" | |
class="image-round image-responsive"><img /> | |
<span class=" badge xs-badge badge-offline"></span> | |
</div> | |
</div> | |
<div class="number-badges-container"> | |
<div class="shopping__cart"> | |
<span class="material-icons badgemi"> | |
shopping_cart | |
</span> | |
</div> | |
<span class="number-badge lg-number-badge">5</span> | |
<div class="favorite_border"> | |
<span class="material-icons badgemi"> | |
favorite_border | |
</span> | |
</div> | |
<span class="number-badge lg-number-badge">99+</span> | |
</div> |
Example of Buttons Example of Primary Button Styles Whenever you want your user to click on a link or button, use primary style buttons. Example of Secondary Button Styles If you want user not to pay attention to buttons then use Secondary buttons. Example of Button with icon and Floating action Button Button with icon can be used in cards to complete the UI. For class and html, check below code. Floating-action buttons can be customized by adding the font-awesome icon of your choice.
Example of Cards Example of Horizontal Cards Horizontal cards contains the content and actions about a single subject. Cards are surfaces that display content and actions on a single topic.It focuses on the content, while presenting actions inline with the content. Example of Vertical Cards Vertical cards contains the content and actions about a single subject. Cards are surfaces that display content and actions on a single topic.It focuses on the content, while presenting actions in column form with the content.
<div class="horizontal-card"> | |
<img | |
class="horizontal-card__image" | |
src="https://i.ibb.co/SRn0LwX/icons8-html-5-480.png" | |
alt="image" | |
/> | |
<div class="horizontal-card__content"> | |
<h2 class="horizontal-card__title">HTML Rice</h2> | |
<h3 class="horizontal-card__price">$5000</h3> | |
<p class="horizontal-card__description"> | |
This is Rice is purely crafted and grown organically. | |
</p> | |
<h3 class="horizontal-card__ratings">5 Star</h3> | |
<h4 class="horizontal-card__stock">Stock: InStock</h4> | |
</div> | |
<div class="horizontal-card__add-to-cart"> | |
<button class="btn btn-primary icon"> | |
Add to Cart | |
<span class="material-icons buttonmi"> shopping_cart </span> | |
</button> | |
</div> | |
<div class="horizontal-card__add-to-wishlist"> | |
<button class="btn btn-success icon"> | |
Add to Wish | |
<span class="material-icons buttonmi"> favorite_border </span> | |
</button> | |
</div> | |
</div> | |
<!-- Horizontal card with out of stock and no image --> | |
<div class="horizontal-card"> | |
<!-- <img | |
class="horizontal-card__image" | |
src="https://i.ibb.co/SRn0LwX/icons8-html-5-480.png" | |
alt="image" | |
/> --> | |
<div class="horizontal-card__content"> | |
<h2 class="horizontal-card__title">HTML Rice</h2> | |
<h3 class="horizontal-card__price">$5000</h3> | |
<p class="horizontal-card__description"> | |
This is Rice is purely crafted and grown organically. | |
</p> | |
<h3 class="horizontal-card__ratings">5 Star</h3> | |
<h4 class="horizontal-card__stock">Stock:No Stock</h4> | |
</h4> | |
</div> | |
<div class="horizontal-card__add-to-cart"> | |
<button class="btn btn-primary icon" disabled> | |
Add to Cart | |
<span class="material-icons buttonmi"> shopping_cart </span> | |
</button> | |
</div> | |
<div class="horizontal-card__add-to-wishlist"> | |
<button class="btn btn-success icon" disabled> | |
Add to Wish | |
<span class="material-icons buttonmi"> favorite_border </span> | |
</button> | |
</div> | |
</div> | |
<!-- Vertical Card with icons --> | |
<div class="vertical-card"> | |
<img | |
class="vertical-card__image" | |
src="https://i.ibb.co/SRn0LwX/icons8-html-5-480.png" | |
alt="image" | |
/> | |
<div class="vertical-card__content"> | |
<h2 class="vertical-card__title"> | |
HTML Rice | |
<span class="material-icons cardmi" title="Authentic Product"> | |
check_circle | |
</span> | |
</h2> | |
<h3 class="vertical-card__price">$5000</h3> | |
<p class="vertical-card__description"> | |
This is Rice is purely crafted and grown organically. | |
</p> | |
<h3 class="vertical-card__ratings">5 Star</h3> | |
<h4 class="vertical-card__stock">Stock: InStock</h4> | |
<div class="vertical-card__buttons"> | |
<div class="vertical-card__add-to-cart"> | |
<button class="btn btn-primary icon"> | |
Add to Cart | |
<span class="material-icons buttonmi"> shopping_cart </span> | |
</button> | |
</div> | |
<div class="vertical-card__add-to-wishlist"> | |
<button class="btn btn-success icon"> | |
Add to Wish | |
<span class="material-icons buttonmi"> favorite_border </span> | |
</button> | |
</div> | |
</div> | |
</div> | |
</div> |
Example of Responsive Images You can add class responsive-image to make your image fit the width of container. It's height will get adjusted by keeping the aspect ratio same. If you want to change the aspect ratio, you will have to crop the image Example of Responsive Images It's height will get adjusted by keeping the aspect ratio same, use class class="responsive-image" to make image responsive. Example of Round Images round images can be added by adding class class="round-image" to the image.
<img class="image-item responsive-image" src="/imagepath" alt="image"> | |
<img class="image-item round-image" src="/imagepath" alt="image"> |
Example of Inputs Inputs are used to collect data from the user. They are used to collect text, numbers, and other data. There are different type of Input that we can use to collect data such as calander to collect date, text to collect text, number to collect number, etc.
<input class="input__field" type="text" name="name" placeholder="Name" required /> | |
<input class="input__field" type="email" name="email" placeholder="Email" required/> | |
<input class="input__field" type="tel" name="telnumber" inputmode="numeric" pattern="[0-9]*" placeholder="Phone Number" required /> | |
<input class="input__field" type="password" name="input password" placeholder="Password" required minlength="6"/> | |
<input class="input__field" type="submit" name="input submit" required /> |
Add class according to bullet style. Copy html code below and add your desired list items.
<ul> | |
<li>Item-1</li> | |
<li>Item-2</li> | |
<li>Item-3</li> | |
</ul> | |
<ul class="list-style-circle"> | |
<li>Item-1</li> | |
<li>Item-2</li> | |
<li>Item-3</li> | |
</ul> | |
<ul class="list-style-square"> | |
<li>Item-1</li> | |
<li>Item-2</li> | |
<li>Item-3</li> | |
</ul> | |
<ul class="list-style-none"> | |
<li>Item-1</li> | |
<li>Item-2</li> | |
<li>Item-3</li> | |
</ul> | |
</div> | |
<div class="ordered-list-examples"> | |
<!-- This is default list --> | |
<ol> | |
<li>List item with numbers</li> | |
<li>List item with numbers</li> | |
<li>List item with numbers</li> | |
</ol> | |
<ol class="list-style-decimal-leading-zero"> | |
<li>List item with numbers</li> | |
<li>List item with numbers</li> | |
<li>List item with numbers</li> | |
</ol> | |
<ol class="list-style-lower-alphabets"> | |
<li>List item with lower alphabets</li> | |
<li>List item with lower alphabets</li> | |
<li>List item with lower alphabets</li> | |
</ol> | |
<ol class="list-style-upper-alphabets"> | |
<li>List item with upper alphabets</li> | |
<li>List item with upper alphabets</li> | |
<li>List item with upper alphabets</li> | |
</ol> | |
<ol class="list-style-lower-roman"> | |
<li>List item with lower roman</li> | |
<li>List item with lower roman</li> | |
<li>List item with lower roman</li> | |
</ol> | |
<ol class="list-style-upper-roman"> | |
<li>List item with upper roman</li> | |
<li>List item with upper roman</li> | |
<li>List item with upper roman</li> | |
</ol> |
For heading u can use h1, h2, h3, h4, h5, h6 elements. The same font-styling is present for class names h1, h2, h3, h4, h5, h6 class. You can add one of these classes to style the text.
<div class="h1">Heading-1</div> | |
<div class="h2">Heading-2</div> | |
<div class="h3">Heading-3</div> | |
<div class="h4">Heading-4</div> | |
<div class="h5">Heading-5</div> | |
<div class="h6">Heading-6</div> | |
<div class="bold-text">This is bold text</div> | |
<div class="striked-text">This is stricked text</div> | |
<div class="small-text">This is extra small text</div> | |
<div class="gray-text">This is gray text</div> | |
<div class="center-text">This is center text</div> |
Navigation can contain links, buttons, icons, and other elements, and when clicked on will navigate to a different page or section of the application.
Example of Model The modal component provides a solid foundation for creating dialogs, popovers, lightboxes, or whatever else.
<button id="myBtn">Open Modal</button> | |
<!-- The Modal --> | |
<div id="myModal" class="modal"> | |
<!-- Modal content --> | |
<div class="modal-content"> | |
<span class="close">×</span> | |
<p>this is a demo model example</p> | |
</div> | |
</div> | |
<!-- JS Code --> | |
var modal = document.getElementById("myModal"); | |
// Get the button that opens the modal | |
var btn = document.getElementById("myBtn"); | |
// Get the <span> element that closes the modal | |
var span = document.getElementsByClassName("close")[0]; | |
// When the user clicks the button, open the modal | |
btn.onclick = function () { | |
modal.style.display = "block"; | |
} | |
// When the user clicks on <span> (x), close the modal | |
span.onclick = function () { | |
modal.style.display = "none"; | |
} | |
// When the user clicks anywhere outside of the modal, close it | |
window.onclick = function (event) { | |
if (event.target == modal) { | |
modal.style.display = "none"; | |
} |
Ratings are used to indicate the rating of a product or service.
<h4>Mood Rating</h4> | |
<div class="rating"> | |
<div class="good-rating" title="Good"><span class="material-icons ratingmi"> | |
mood | |
</span> | |
</div> | |
<div class="average-rating" title="Average"><span class="material-icons ratingmi"> | |
sentiment_satisfied | |
</span> | |
</div> | |
<div class="bad-rating" title="Bad"> <span class="material-icons ratingmi"> | |
mood_bad | |
</span> | |
</div> | |
</div> | |
<h4>Star Rating </h4> | |
<div class="star-rating"> | |
<span class="fa fa-star checked"></span> | |
<span class="fa fa-star checked"></span> | |
<span class="fa fa-star checked"></span> | |
<span class="fa fa-star"></span> | |
<span class="fa fa-star"></span> | |
</div> |
Example of Grids There are different type of grids available in the grid component and are used to create different layouts . some of examples are as follows: 50:50 GridsAlert 50:50 Grids are used to create equal width and height grids. use the following code to create 50:50 grids. class="grid-50-50" 70:30 Grids 70:30 Grids are used to create 70% width and 30% height grids. use the following code to create 50:50:50 grids. class="container-70-30" 30:70 Grids 30:70 Grids are used to create 30% width and 70% height grids. use the following code to create 50:50:50 grids. class="container-30-70"
<div class="grid-50-50"> | |
<div class="item1">Item-1</div> | |
<div class="item2">Item-2</div> | |
</div> | |
<div class="grid-30-70"> | |
<div class="item1">Item-1</div> | |
<div class="item2">Item-2</div> | |
</div> | |
<div class="grid-70-30"> | |
<div class="item1">Item-1</div> | |
<div class="item2">Item-2</div> | |
</div> |
This component can be used for toast or snackbar component. Toast is mostly used to show feedback message. Snackbar is to used show message that need user action .
<div class="success-toast">This is an example of success toast | |
<span class="material-icons toastmi"> | |
close | |
</span> | |
</div> | |
<div class="warning-toast">This | |
is an example of warning toast | |
<span | |
class="material-icons toastmi"> | |
close | |
</span> | |
</div> | |
<div class="error-toast"> | |
This is an example of error toast | |
<span class="material-icons toastmi"> | |
close | |
</span> | |
</div> |