New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details → →
Socket
Book a DemoSign in
Socket

bootstrap-css-module

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap-css-module

Get all the [Bootstrap](https://getbootstrap.com) classes as a module. đź”—

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Bootstrap CSS Module

Get all the Bootstrap classes as a module. đź”—

Demo > đź”—

Example code

import React from "react";
import bs from "bootstrap-css-module";

const getBsClass = (classNames = "") =>
  classNames
    .split(" ")
    .map((className) => (bs[className] ? bs[className] : className))
    .join(" ")
    .trim();

export default function App() {
  return (
    <div className={getBsClass("container mt-2")}>
      <div className={getBsClass("alert alert-primary")}>Primary Alert</div>
      <div className={getBsClass("alert alert-secondary")}>Secondary Alert</div>
      <button className={getBsClass("btn btn-primary mx-2")}>
        Primary Button
      </button>
      <button className={getBsClass("btn btn-secondary mx-2")}>
        Primary Button
      </button>
      <button className={getBsClass("btn btn-warning mx-2")}>
        Primary Button
      </button>
    </div>
  );
}

FAQs

Package last updated on 18 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts