Capital Framework UI Library

11.0.1 · abandoned · verified Sun Apr 19

Capital Framework is a deprecated and abandoned front-end UI library developed by the Consumer Financial Protection Bureau (CFPB). It provides a collection of reusable HTML, CSS (Less), and JavaScript components designed to help build consistent user interfaces. The project's GitHub repository was archived and marked as read-only on July 10, 2020, with an explicit recommendation to migrate to the CFPB's successor design system. While the package version 11.0.1 is listed, active development ceased prior to or around the archiving date, meaning there is no ongoing maintenance, bug fixes, or new feature releases. The framework relies heavily on Less for its styling, requiring `autoprefixer` to ensure cross-browser compatibility. Its key differentiator was being the official UI framework for CFPB projects, providing a standardized, accessible base for government-related web development.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to set up a basic project, compile Capital Framework's Less files to CSS with Autoprefixer, and include the resulting styles in an HTML page. It defines a `package.json` script using `lessc` and showcases importing the main framework Less file, then applying some core styles and components in HTML.

{
  "name": "my-capital-framework-project",
  "version": "1.0.0",
  "description": "Demonstrates basic usage of Capital Framework.",
  "scripts": {
    "build:less": "lessc --autoprefix=\"> 0.5%, not dead\" src/index.less dist/index.css"
  },
  "dependencies": {
    "capital-framework": "^11.0.1",
    "less": "^4.0.0",
    "less-plugin-autoprefixer": "^2.0.0"
  }
}

// src/index.less
@import "../node_modules/capital-framework/less/capital-framework.less";

body {
  padding: 1rem;
}

.wrapper {
  max-width: 960px;
  margin: 0 auto;
  .cf-btn {
    margin-right: 10px;
  }
}

// public/index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Capital Framework Demo</title>
    <link rel="stylesheet" href="./dist/index.css">
</head>
<body>
    <div class="wrapper">
        <h1>Welcome to Capital Framework</h1>
        <button class="cf-btn cf-btn__primary">Primary Button</button>
        <button class="cf-btn cf-btn__secondary">Secondary Button</button>
        <p class="cf-text">This is a paragraph styled by Capital Framework.</p>
    </div>
</body>
</html>

view raw JSON →