npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

st-bootstrap

v2.0.0-beta.2

Published

<h1 align="center">Bootstrap 4 for SpringType</h2>

Downloads

3

Readme

"How to use Bootstrap 4 with SpringType?"

SpringType comes with a lazy, fault-tolerant VDOM implementation that allows you to use standard HTML + CSS. Unlike other modern frontend frameworks, SpringType doesn't need any special wrapper component libraries.

This means, you can just use the standard Bootstrap 4 SCSS/CSS, it's HTML and JS plugins like we did back in the good old days - but with components and VDOM :-)

You can find a working integration example in the playground folder.

For your convenience, we've created a scaffolding template for SpringType / Bootstrap 4 projects. To use it, please install the SpringType scaffolding CLI st-create:

yarn add global st-create

Then simply run:

st-create -c project -t bootstrap-4 -n MyBootstrapProject

...and seconds later, a SpringType / Bootstrap 4 application will be created for you.

If you don't want to use st-create, the process of integrating Bootstrap 4 in a SpringType projects (or even any TypeScript project), is quite straigt forward.

You can choose to integrate third-party libraries via CDN or import them in JS to include them into the application JS bundle.

Install these dependencies:

npm i st-bootstrap bootstrap jquery popper.js

OR: yarn add st-bootstrap bootstrap jquery popper.js

  • jQuery is a Bootstrap 4 dependency
  • Bootstrap 4 comes with the SCSS (SASS) stylesheets and the jQuery plugins for interactive components
  • popper.js for

Make sure to actually import these dependencies (e.g. in src/index.tsx):

// import jQuery, Bootstrap, popper.js
import { importBootstrap } from "st-boostrap";

st.run(async() => {

    // dynamically imports the dependencies jquery, bootstrap and popper.js
    await importBootstrap();

    // enabling SpringType support for Bootstrap 4 tooltip components 
    setupBootstrapComponent('tooltip');

    st.render(<YourAppIndex />);
});

The other option is to integrate Bootstrap 4 and it's dependencies in the <head> of your index.html just like described in the official Bootstrap 4 docs:

  <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

Make sure not to import and call importBootstrap() then.

Some components require an initialization (e.g. tooltips). To do this, just implement the lifecycle method onAfterInitialRender just like described in the official Bootstrap 4 docs:

  onAfterInitialRender() {

    // tooltip integration
    $(() => {
        $('[data-toggle="tooltip"]', this.el).tooltip()
    });
  }

We also suggest, to create an SCSS file to integrate the Bootstrap 4 SCSS with custom themeing support. Create a theme.scss in your src folder:

$theme-colors: (
    "primary": #1a6da9,
    "secondary": #2a863c,
);

@import "bootstrap/scss/bootstrap";

To transpile the SCSS file to CSS, just activate the SASS processing feature of st-start by creating or modfiying the file st.config.js. Add the key staticStyleEntryPoints:

module.exports = {
    staticStyleEntryPoints: {
        'src/theme.scss': 'dist/theme.css'
    },
};

Finally, import the resulting dist/theme.scss CSS file in the <head> section of your src/index.html file:

<head>

  <!-- added this for Font Awesome icon support -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" />

  <!-- just using the most recent style globally -->
  <link href="../dist/theme.css" rel="stylesheet">

</head>

Most Bootstrap apps also use Font Awesome, so we recommend importing Font Awesome as well.

Please help out to make this project even better and see your name added to the list of our
CONTRIBUTORS.md :tada: