Skip to content
UNASPACE

CSS Frameworks

This content is for Frontend. Switch to the latest version for up-to-date documentation.

CSS frameworks are pre-prepared libraries that are meant to be used for easier, more standards-compliant web design using the Cascading Style Sheets language.

Bootstrap is a powerful, feature-packed frontend toolkit. It’s one of the most popular CSS frameworks in the world.

  • Component-based: Provides a wide range of pre-built UI components like buttons, modals, and navbars.
  • Grid System: Uses a powerful flexbox grid system to build layouts of all shapes and sizes.
  • JavaScript Plugins: Includes several jQuery (or vanilla JS in newer versions) plugins for UI interactions.
  • Good for: Rapid prototyping and building consistent UIs quickly without deep CSS knowledge.
<!-- Example Bootstrap Button and Grid -->
<div class="container text-center">
<div class="row">
<div class="col">
<button type="button" class="btn btn-primary">Primary Button</button>
</div>
</div>
</div>

Tailwind CSS is a utility-first CSS framework for rapidly building custom user interfaces.

  • Utility-first: Instead of pre-built components, it provides low-level utility classes (like flex, pt-4, text-center) that let you build completely custom designs.
  • Highly Customizable: You can configure everything from colors to spacing in a single configuration file.
  • PurgeCSS: Automatically removes unused CSS in production, keeping the bundle size extremely small.
  • Good for: Developers who want full control over the design without writing raw CSS from scratch.
<!-- Example Tailwind Card -->
<div class="max-w-sm rounded overflow-hidden shadow-lg p-6 bg-white">
<h2 class="font-bold text-xl mb-2 text-blue-600">Tailwind Card</h2>
<p class="text-gray-700 text-base">
Building UI components with utility classes.
</p>
<button
class="mt-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
>
Click Me
</button>
</div>

CSS preprocessors extend CSS with features like variables, nesting, mixins, and functions. They compile down to standard CSS.

The most widely used CSS preprocessor. SCSS syntax is a superset of CSS — any valid CSS is valid SCSS.

  • Variables: $primary: #3498db;
  • Nesting: Write CSS that mirrors your HTML structure.
  • Mixins: Reusable groups of declarations.
  • Partials & Imports: Split CSS into modular files.
_variables.scss
$primary: #3498db;
$radius: 8px;
// styles.scss
@use 'variables' as *;
.card {
border-radius: $radius;
background: $primary;
&:hover {
opacity: 0.9;
}
.title {
font-weight: bold;
}
}

A CSS preprocessor similar to Sass with a JavaScript-based compiler. Used historically by Bootstrap (v3).

Not a preprocessor itself — PostCSS is a tool for transforming CSS with JavaScript plugins. It powers tools like Autoprefixer and is used internally by Tailwind CSS.

  • Autoprefixer: Automatically adds vendor prefixes (-webkit-, -moz-).
  • Plugin-Based: Choose only the features you need.

CSS-in-JS libraries let you write styles directly in your JavaScript/TypeScript files, scoping them to individual components. Common in the React ecosystem.

A build-step approach where CSS class names are locally scoped by default. No runtime cost — styles are extracted at build time.

Button.module.css
.primary {
background: blue;
color: white;
}
import styles from './Button.module.css';
<button className={styles.primary}>Click</button>;

Uses tagged template literals to write actual CSS in your JS. Generates unique class names at runtime.

import styled from 'styled-components';
const Button = styled.button`
background: blue;
color: white;
padding: 0.5rem 1rem;
&:hover {
opacity: 0.8;
}
`;

Similar to styled-components with additional flexibility. Can be used as a css prop or a styled API.

Also fits here — Tailwind is increasingly used as an alternative to CSS-in-JS by providing atomic utility classes directly in JSX.


Pre-built UI component libraries save development time and provide consistent, accessible design patterns out of the box.

LibraryEcosystemStyle
Material UI (MUI)ReactGoogle’s Material Design. Full-featured, opinionated styling.
shadcn/uiReactCopy-paste components built on Radix + Tailwind. You own the code.
Radix UIReactUnstyled, accessible primitives. You bring your own styles.
Headless UIReact / VueUnstyled, accessible components from the Tailwind team.
DaisyUIAny (Tailwind plugin)Pre-built component classes for Tailwind CSS.
VuetifyVueMaterial Design components for Vue.
PrimeVue / PrimeReactVue / ReactLarge library of enterprise-grade UI components.
Ant DesignReactEnterprise-level UI design language from Alibaba.

Beyond CSS animations, dedicated libraries provide more control for complex motion design.

LibraryDescription
GSAPIndustry-standard animation library. Handles complex timelines, scroll-based animations, and SVG morphing.
Framer MotionDeclarative animation library for React. Gesture-based and layout animations.
LottieRenders After Effects animations (exported as JSON) natively on the web.
Auto AnimateZero-config, drop-in animation utility for adding motion to your app.
Built with passion by Ngineer Lab