Alerts

The alert dialog displays some important information to the user. StackUI provides 4 different color schemes of alerts to show case relevant system alert to users. Class alert can be used along with the other classes to give the sementic meanings to the alert messages. alert-success, alert-warning, alert-info, alert-error

alert-success

Profile has been updated successfully!

alert-warning

Low disk storage, clear some space.

alert-info

An update is available to install.

alert-error

There was an error processing your request!

<!-- Alerts Component : StackUI Component Library -->
<!-- Success-alert -->
<div class="alert alert-success">
<div class="alert-icon">
<img
src="./assets/alert-icons/success-alert.svg"
alt="alert-success"
/>
</div>
<div class="alert-text">
<p>Profile has been updated successfully!</p>
</div>
</div>
<!-- warning-alert -->
<div class="alert alert-warning">
<div class="alert-icon">
<img
src="./assets/alert-icons/warning-alert.svg"
alt="alert-success"
/>
</div>
<div class="alert-text">
<p>Low disk storage, clear some space.</p>
</div>
</div>
<!-- info-alert -->
<div class="alert alert-info">
<div class="alert-icon">
<img
src="./assets/alert-icons/info-alert.svg"
alt="alert-success"
/>
</div>
<div class="alert-text">
<p>An update is available to install.</p>
</div>
</div>
<!-- error-alert -->
<div class="alert alert-error">
<div class="alert-icon">
<img
src="./assets/alert-icons/error-alert.svg"
alt="alert-success"
/>
</div>
<div class="alert-text">
<p>There was an error processing your request!</p>
</div>
</div>
view raw alerts.html hosted with ❤ by GitHub

Avatars

Avatar is basically the display picture of a user. It generally is very small in size and the sizes can vary depending on the use case. Stack UI provides a generic avatar class that can be used in association with any of 6 standard sizes for your avatars. avatar-xs, avatar-xs, avatar-s, avatar-m, avatar-l, avatar-xl, avatar-xxl. Check below the important classes and the way to implement.

girl-with-curly-hairs
man-smiling
man-winking
smiling-girl
marathi-woman
rajasthani-male
<!-- Avatar Component : StackUI Component Library -->
<div class="avatar-wrapper">
<div class="avatar avatar-xs">
<img src="./assets/avatar/girl-with-curly-hairs.svg" alt="" />
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar avatar-s">
<img src="./assets/avatar//man-smiling.svg" alt="" />
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar avatar-m">
<img src="./assets/avatar/man-winking.svg" alt="" />
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar avatar-l">
<img src="./assets/avatar/smiling-girl.svg" alt="" />
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar avatar-xl">
<img src="./assets/avatar/marathi-woman.svg" alt="" />
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar avatar-xxl">
<img src="./assets/avatar/rajasthani-male.svg" alt="" />
</div>
</div>
view raw avatar.html hosted with ❤ by GitHub

Text Avatar

Similar to image avatars, text avatars can use those classes. One thing to note is that text avatars should mandatorily have the avatar-text.

RK
SS
RS
UI
JS
<!-- Text Avatar : StackUI Component Library -->
<div class="avatar-wrapper">
<div class="avatar avatar-m avatar-text">
<span>RK</span>
</div>
</div>

Avatar Group

An avatar group can be used to showcase how many users contributed or participated in some event. To implement a avatar group just wrap all the avatars within a container with class named avatar-group.

marathi-woman
rajasthani-male
girl-with-curly-hairs
man-winking
happy-female
+56
<!-- AVATAR GROUP : StackUI Component Library-->
<div class="avatar-group">
<div class="avatar avatar-l">
<img src="./assets/avatar/marathi-woman.svg" alt="" />
</div>
<div class="avatar avatar-l">
<img src="./assets/avatar/rajasthani-male.svg" alt="" />
</div>
<div class="avatar avatar-l">
<img src="./assets/avatar/girl-with-curly-hairs.svg" alt="" />
</div>
<div class="avatar avatar-l">
<img src="./assets/avatar/man-winking.svg" alt="" />
</div>
<div class="avatar avatar-l">
<img src="./assets/avatar/happy-female.svg" alt="" />
</div>
<div class="avatar avatar-l avatar-text">
<span>+56</span>
</div>
</div>

Badges

Badges can be used to communicate the status of a user. It can also be used a signal for other users to understand if someone is online or offline.

Avatar with badges

Badges indicate the status of the user. example-> Green: online
For badges on image avatars use a span tag that has following classes: avatar-badge along with any of these classes: badge-red, badge-green, badge-yellow

rajasthani-male
RK
marathi-woman
<!-- Badges on Avatar : StackUI Component Library -->
<div class="avatar-wrapper">
<div class="avatar avatar-l">
<img src="./assets/avatar/rajasthani-male.svg" alt="" />
<span class="avatar-badge badge-green"></span>
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar avatar-l avatar-text">
<span>RK</span>
<span class="avatar-badge badge-red"></span>
</div>
</div>
<div class="avatar-wrapper">
<div class="avatar avatar-l">
<img src="./assets/avatar/marathi-woman.svg" alt="" />
</div>
<span class="avatar-badge badge-yellow"></span>
</div>

Icons with badges

For badges on icons simply use a span tag that has the class: badge along with any of these classes: badge-red, badge-green, badge-yellow

9+ 15 new 50
<!-- Badges on Icons : StackUI Component Library -->
<span class="icon-badge">
<span class="badge badge-green">9+</span>
<ion-icon class="icon" name="home"></ion-icon>
</span>
<span class="icon-badge">
<span class="badge badge-red">15</span>
<ion-icon class="icon" name="heart"></ion-icon>
</span>
<span class="icon-badge">
<span class="badge badge-yellow">new</span>
<ion-icon class="icon" name="settings"></ion-icon>
</span>
<span class="icon-badge">
<span class="badge badge-green">50</span>
<ion-icon class="icon" name="cart"></ion-icon>
</span>

Buttons

The Button component can be used to complete an action or a specific operation such as submitting a form, or sending some document or mails etc.

There are four different categories of buttons provided by StackUI. Each resembles the sementic meaning that it holds. btn-primary, btn-info, btn-warning, btn-error. Use any of these along with the btn class.

<!-- Buttons Component: StackUI Component Library -->
<button class="btn btn-primary">Primary</button>
<button class="btn btn-info">Information</button>
<button class="btn btn-warning">Warning</button>
<button class="btn btn-danger">Danger</button>
view raw buttons.html hosted with ❤ by GitHub

Outline Buttons

Use the class btn-outline along with any of the two classes depending on the primary and secondary color of your app: outline-primary, outline-secondary

<!-- Outline Buttons: StackUI Component Library-->
<button class="btn-outline outline-primary">Outline</button>
<button class="btn-outline outline-secondary">Buttons</button>

Link Buttons

Any link from "a" tag can be styled into button. Using the same button class with the varient user likes to incorporate. Mandatory class to include is btn-link

view raw link-btns.html hosted with ❤ by GitHub

Icon Buttons

Any icon can be styled as a button using the classes provided by the StackUI for buttons component. Mandatory class to include is btn-icon

<!-- Icon Buttons Component : StackUI Component Library -->
<button class="btn-icon btn-info">
<ion-icon class="btn-icon-icon" name="arrow-forward"></ion-icon>
</button>
<button class="btn-icon btn-warning">
<ion-icon class="btn-icon-icon" name="airplane"></ion-icon>
</button>
view raw icon-btn.html hosted with ❤ by GitHub

Floating Buttons

Floating buttons are usually icon buttons that calls for an important action on the overall page. Generally located at bottom right.
Stack UI provides few classes that makes the design look cool and clean. But the user has to explicitly define the position of the buttons according to their respective use cases. By default it is absolute to the viewport.

<!-- Floating Buttons Component: StackUI Library-->
<button class="btn-float btn-primary">
<ion-icon class="btn-float-icon" name="call"></ion-icon>
</button>

Cards

A card is a group of related information, generally comprises of an Image, a title, some data like price, rating, description and sometimes also has a call to action buttons.

Normal Card Variants

The following examples contains the Textual Cards and the Cards with close icon

Textual Card

Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae saepe sequi dolor natus? Perferendis, omnis harum necessitatibus assumenda unde consectetur corrupti blanditiis dolore repudiandae? Id earum rerum quis dolor autem maiores assumenda culpa ipsam, esse perspiciatis enim. Libero, aliquam repellat nemo ex, quidem odio, sit illum nihil architecto laudantium reprehenderit!

Card that closes

Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae saepe sequi dolor natus? Perferendis, omnis harum necessitatibus assumenda unde consectetur corrupti blanditiis dolore repudiandae? Id earum rerum quis dolor autem maiores assumenda culpa ipsam, esse perspiciatis enim. Libero, aliquam repellat nemo ex, quidem odio, sit illum nihil architecto laudantium reprehenderit!

<!-- Card variant: StackUI Component Library -->
<!-- Normal Textual Card -->
<div class="card">
<h3 class="card-text-primary">Textual Card</h3>
<p class="card-text-secondary"><span class="primary-color">Lorem</span> ipsum dolor sit amet consectetur adipisicing elit. Molestiae saepe sequi dolor natus? Perferendis, omnis harum necessitatibus assumenda unde consectetur corrupti blanditiis dolore repudiandae? Id earum rerum quis dolor autem maiores assumenda culpa ipsam, esse perspiciatis enim. Libero, aliquam repellat nemo ex, quidem odio, sit illum nihil architecto laudantium reprehenderit!</p>
</div>
<!-- Card with close icon -->
<div class="card">
<h3 class="card-text-primary">Card that closes</h3>
<p class="card-text-secondary"><span class="primary-color">Lorem</span> ipsum dolor sit amet consectetur adipisicing elit. Molestiae saepe sequi dolor natus? Perferendis, omnis harum necessitatibus assumenda unde consectetur corrupti blanditiis dolore repudiandae? Id earum rerum quis dolor autem maiores assumenda culpa ipsam, esse perspiciatis enim. Libero, aliquam repellat nemo ex, quidem odio, sit illum nihil architecto laudantium reprehenderit!</p>
<div class="close">
<ion-icon class="close-icon" name="close-circle-outline"></ion-icon>
</div>
</div>
view raw cards.html hosted with ❤ by GitHub

Vertical Cards: Image & Text

Few left tesseract

3D Printed Tesseract

Hub 3D, Delhi

4.3

1199

1849

1679 reviews

delivery by tomorrow

Trending tesseract

3D Printed Rudra

Hub 3D, Delhi

4.6

899

1549

7.9K reviews

delivery by 8th March

Out Of Stock Out Of Stock tesseract

3D Printed Diamond

Hub 3D, Delhi

4.8

1999

2549

5.7K reviews

currently Sold Out

<!-- Vertical Card Component : StackUI Component Library -->
<div class="card-wrapper-v">
<div class="img-container">
<span class="text-badge trending">Trending</span>
<img src="./assets/card/rudra.png" alt="tesseract" />
</div>
<div class="card-details">
<h2 class="card-text-primary">3D Printed Rudra</h2>
<p class="card-text-tertiary">Hub 3D, Delhi</p>
<div class="price-and-rating">
<div class="rating">
<p class="card-text-tertiary">4.6</p>
<ion-icon class="card-icon" name="star-half"></ion-icon>
</div>
<div class="price">
<span>₹</span>
<p class="card-text-primary">899</p>
<del class="card-text-secondary">1549</del>
</div>
</div>
<div class="discount-and-reviews">
<p class="card-text-tertiary">7.9K reviews</p>
<p class="card-text-tertiary secondary-color">
delivery by 8th March
</p>
</div>
<div class="card-cta">
<button class="btn-outline outline-primary">
Add to cart
</button>
<button class="btn btn-primary">Buy now</button>
</div>
</div>
</div>
<!-- For Out Of Stock Product -->
<div class="card-wrapper-v">
<div class="img-container">
<span class="text-badge hot">Out Of Stock</span>
<span class="out-of-stock">Out Of Stock</span>
<img src="./assets/card/diamond.png" alt="tesseract" />
</div>
<div class="card-details">
<h2 class="card-text-primary">3D Printed Diamond</h2>
<p class="card-text-tertiary">Hub 3D, Delhi</p>
<div class="price-and-rating">
<div class="rating">
<p class="card-text-tertiary">4.8</p>
<ion-icon class="card-icon" name="star-half"></ion-icon>
</div>
<div class="price">
<span>₹</span>
<p class="card-text-primary">1999</p>
<del class="card-text-secondary">2549</del>
</div>
</div>
<div class="discount-and-reviews">
<p class="card-text-tertiary">5.7K reviews</p>
<p class="card-text-tertiary color-red">
currently Sold Out
</p>
</div>
<div class="card-cta">
<button class="btn btn-primary">Notify Me!</button>
</div>
</div>
</div>

Horizontal Cards: Image & Text

The html structure remains the same for horizontal class as well, One just need to replace the main wrapper class from card-wrapper-v to card-wrapper-h. See below the code example for better understanding.

Few left tesseract

3D Printed Tesseract

Hub 3D, Delhi

4.3

1199

1849

1679 reviews

delivery by tomorrow

Trending tesseract

3D Printed Rudra

Hub 3D, Delhi

4.6

899

1549

7.9K reviews

delivery by 8th March

Out Of Stock Out Of Stock tesseract

3D Printed Diamond

Hub 3D, Delhi

4.8

1999

2549

5.7K reviews

currently Sold Out

<!-- Horizontal Card Component : StackUI Component Library -->
<div class="card-wrapper-h">
<div class="img-container">
<span class="text-badge trending">Trending</span>
<img src="./assets/card/rudra.png" alt="tesseract" />
</div>
<div class="card-details">
<h2 class="card-text-primary">3D Printed Rudra</h2>
<p class="card-text-tertiary">Hub 3D, Delhi</p>
<div class="price-and-rating">
<div class="rating">
<p class="card-text-tertiary">4.6</p>
<ion-icon class="card-icon" name="star-half"></ion-icon>
</div>
<div class="price">
<span>₹</span>
<p class="card-text-primary">899</p>
<del class="card-text-secondary">1549</del>
</div>
</div>
<div class="discount-and-reviews">
<p class="card-text-tertiary">7.9K reviews</p>
<p class="card-text-tertiary secondary-color">
delivery by 8th March
</p>
</div>
<div class="card-cta">
<button class="btn-outline outline-primary">
Add to cart
</button>
<button class="btn btn-primary">Buy now</button>
</div>
</div>
</div>
<!-- For Out Of Stock Products -->
<div class="card-wrapper-h">
<div class="img-container">
<span class="text-badge hot">Out Of Stock</span>
<span class="out-of-stock">Out Of Stock</span>
<img src="./assets/card/diamond.png" alt="tesseract" />
</div>
<div class="card-details">
<h2 class="card-text-primary">3D Printed Diamond</h2>
<p class="card-text-tertiary">Hub 3D, Delhi</p>
<div class="price-and-rating">
<div class="rating">
<p class="card-text-tertiary">4.8</p>
<ion-icon class="card-icon" name="star-half"></ion-icon>
</div>
<div class="price">
<span>₹</span>
<p class="card-text-primary">1999</p>
<del class="card-text-secondary">2549</del>
</div>
</div>
<div class="discount-and-reviews">
<p class="card-text-tertiary">5.7K reviews</p>
<p class="card-text-tertiary color-red">
currently Sold Out
</p>
</div>
<div class="card-cta">
<button class="btn btn-primary">Notify Me!</button>
</div>
</div>
</div>

Responsive Images

Responsive images change their aspect ratio according to the container it is contained in. Stack UI provides the container img-wrapper that allows you to wrap your image and get it displayed in a responsive nature. You can change the height and width of the wrapper according to the usecase.

<div class="img-wrapper">
<img src="./assets/image/landscape.jpeg" alt="">
</div>

Round Images

To get your images rounded, simply add the img-round class to your wrapper class.

<div class="img-wrapper img-round">
<img src="./assets/image/landscape.jpeg" alt="">
</div>

Inputs

Inputs are used to collect data from users directly in form of texts, numbers, clicks, checkboxes, radio buttons etc. Different styles are provided by StackUI for your labels, inputs, different colored borders that has sementic meanings. They can be used separately when needed or within a form group.

Feedback Form
<!-- Form Component: StackUI Component Library -->
<form class="input-wrapper border-default">
<div class="form-title">
<h5 class="h5">Feedback Form</h5>
</div>
<label class="label" for="name">Enter your name:</label>
<input
class="text-input border-default"
type="text"
name="name"
id="name"
placeholder="John Doe"
required
/>
<label class="label" for="mobile">Mobile number:</label>
<input
class="text-input border-default"
type="number"
name="mobile"
id="mobile"
placeholder="9876543210"
required
/>
<label for="message" class="label"
>Leave your message below 👇</label
>
<textarea
name="message"
id="message"
cols="30"
rows="5"
class="text-area"
></textarea>
<div class="cta">
<button class="btn btn-primary">Submit</button>
</div>
</form>
view raw form.html hosted with ❤ by GitHub

Input Variations

<!-- Input Variations -->
<!-- Green border to depict correct credentials -->
<label for="border-success" class="label">Correct Credentials</label>
<input type="text" name="border-success" class="text-input border-success">
<!-- Red border to depict incorrect credentials/details -->
<label for="border-error" class="label">Incorrect Details</label>
<input type="text" name="border-error" class="text-input border-error">
<!-- disabled input field -->
<input type="text" name="disabled" class="text-input border-default" placeholder="disabled input field" disabled>
<!-- read-only input field -->
<input type="text" name="disabled-read-only" class="text-input border-default" placeholder="disabled read only" readonly>

Rating

A rating component can be used on any ecommerce platform, where we need to collect user experience with product or service in forms of rating. Use the id rating-star for each stars and the class names according to the value of the star such as rating-star-1, rating-star-2, rating-star-3, rating-star-4, rating-star-5

HTML code for Rating

<!-- Rating Component: StackUI Component Library -->
<ion-icon id="rating-star" class="rating-star-1 star" name="star"></ion-icon>
<ion-icon id="rating-star" class="rating-star-2 star" name="star"></ion-icon>
<ion-icon id="rating-star" class="rating-star-3 star" name="star"></ion-icon>
<ion-icon id="rating-star" class="rating-star-4 star" name="star"></ion-icon>
<ion-icon id="rating-star" class="rating-star-5 star" name="star"></ion-icon>
view raw rating.html hosted with ❤ by GitHub

Javascript code for Rating

// Javascript Code for Rating Component: StackUI Component Library
const ratingStars = document.querySelectorAll('#rating-star');
for(let stars of ratingStars) {
stars.addEventListener('click', (e) => {
const currentStarValue = e.target.classList[0].slice(-1);
for(let i=0; i<currentStarValue; i++) {
ratingStars[i].classList.add('rating-yellow-star');
}
for(let i=currentStarValue; i<5; i++) {
ratingStars[i].classList.remove('rating-yellow-star');
}
})
}
view raw rating.js hosted with ❤ by GitHub

Slider

Sliders are majorly used to take inputs from user that ranges between two values. A minimum value and a maximum value. Wrap your slider with the class slider-container and the slider with the class slider. Also see below the code snippet for more understanding of the usage,

0

<!-- Slider Component: StackUI Component Library -->
<div class="slider-container">
<input id="range-slider" class="slider" type="range" name="slider" value="10" min="0" max="5000">
<p id="range-value" class="p-xs ml1">0</p>
</div>
<!-- Javascript Code -->
const slider = document.querySelector('#range-slider');
const value = document.querySelector('#range-value');
slider.addEventListener('input', (e) => {
value.textContent = e.target.value;
})
view raw slider.html hosted with ❤ by GitHub

Typography

Various text utility classes that can be used to design text based use cases. Below are all the examples for Headings, paragraphs, span, and more. Headings classes span from h1, h2, h3, h4, h5, h6. These heading classes can be associated with the primary-color and secondary-color to color them according to the use case.

Headings

Heading One

Heading Two

Heading Three

Heading Four

Heading Five
Heading Six

Heading One

Heading Two

Heading Three

Heading Four

Heading Five
Heading Six
<!-- Headings Component: StackUI Component Library -->
<!-- Headings with primary color -->
<h1 class="h1 primary-color">Heading One</h1>
<h2 class="h2 primary-color">Heading Two</h2>
<h3 class="h3 primary-color">Heading Three</h3>
<h4 class="h4 primary-color">Heading Four</h4>
<h5 class="h5 primary-color">Heading Five</h5>
<h6 class="h6 primary-color">Heading Six</h6>
<!-- Headings with secondary color -->
<h1 class="h1 secondary-color">Heading One</h1>
<h2 class="h2 secondary-color">Heading Two</h2>
<h3 class="h3 secondary-color">Heading Three</h3>
<h4 class="h4 secondary-color">Heading Four</h4>
<h5 class="h5 secondary-color">Heading Five</h5>
<h6 class="h6 secondary-color">Heading Six</h6>
view raw headings.html hosted with ❤ by GitHub

Paragraphs and Spans

For paragraphs stackUI provides three variant of sizes: p, p-sm, p-xs in decreasing order respectively.

For spans stackUI provides two variant of sizes: span, span-sm in decreasing order respectively.

To color any text into grey you can use: text-grey.

Normal paragraph text.

Small paragraph text.

Extra small paragraph text.

normal span text. small span text.

this is a grey text.

<!-- paragraph texts -->
<p class="p">Normal paragraph text.</p>
<p class="p-sm">Small paragraph text.</p>
<p class="p-xs">Extra small paragraph text.</p>
<!-- spans -->
<span class="span">normal span text.</span>
<span class="span-sm">small span text.</span>
<!-- grey texts -->
<p class="p-sm text-grey">this is a grey text.</p>

Alignment

Align any text using these classes: text-left, text-center, text-right

Centered text

Left-aligned text

Right-aligned text

<p class="p text-center">Centered text</p>
<p class="p text-left">Left-aligned text</p>
<p class="p text-right">Right-aligned text</p>

Lists

Lists are integral part of any webpage, it can be found in navigation component or used to display bunch of related data.

Stacked Lists

StackUI provides different variants of the unordered lists, we can implement any type using the specific classname for the "ul" tag. ul class is common for all in associations with any of these classes: ul-circle,ul-square,ul-disc,ul-alpha,ul-lower-roman,ul-upper-roman respectively.

  • apple
  • guava
  • orange
  • banana
  • pears
  • apple
  • guava
  • orange
  • banana
  • pears
  • apple
  • guava
  • orange
  • banana
  • pears
  • apple
  • guava
  • orange
  • banana
  • pears
  • apple
  • guava
  • orange
  • banana
  • pears
  • apple
  • guava
  • orange
  • banana
  • pears

Spaced Lists

For spaced list items you can use this class ul-flex-spaced and thats it. :)

  • apple
  • guava
  • pears
  • lemon
  • mango
<!-- Lists Component: StackUI Component Library -->
<ul class="ul ul-circle">
<li class="p-sm">apple</li>
<li class="p-sm">guava</li>
<li class="p-sm">orange</li>
<li class="p-sm">banana</li>
<li class="p-sm">pears</li>
</ul>
<!-- Spaced Lists -->
<ul class="ul-flex-spaced">
<li class="p-sm">apple</li>
<li class="p-sm">guava</li>
<li class="p-sm">pears</li>
<li class="p-sm">lemon</li>
<li class="p-sm">mango</li>
</ul>
view raw lists.html hosted with ❤ by GitHub