GithubHelp home page GithubHelp logo

justinmahar / vscode-react-bootstrap-snippets Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 1.0 10.61 MB

๐Ÿ“ VS Code snippets for the React-Bootstrap library. Over 20k installs!

Home Page: https://marketplace.visualstudio.com/items?itemName=justinmahar.react-bootstrap-snippets

License: MIT License

bootstrap snippets vscode react reactjs react-bootstrap reactstrap

vscode-react-bootstrap-snippets's Introduction

React-Bootstrap Snippets

Overview

This extension includes 806 React-Bootstrap snippets for VS Code.

Build apps with React-Bootstrap at your fingertips.

This extension supports:

  • ๐Ÿ™Œ All react-bootstrap components. The complete picture.
  • ๐Ÿ“ฆ import snippets, for quick and easy importing.
  • ๐Ÿ’โ€โ™€๏ธ Example snippets from the docs for convenience.
  • ๐Ÿงฐ Bootstrap utility CSS class snippets for even more convenience!

Just type rb and press Ctrl+Space for autocompletion. VS Code will autocomplete the component you need.

Demo

Read below for more information and gif demos.

Loving it? Rate it here!

Donate

If this project helped you, please consider buying me a coffee. Your support is much appreciated!

Sponsor via GitHub Buy me a coffee Buy me 3 coffees Buy me 5 coffees

Table of Contents

๐Ÿ“š Supported languages (file extensions)

  • JavaScript (.js)
  • JavaScript React (.jsx)
  • TypeScript (.ts)
  • TypeScript React (.tsx)

react-bootstrap Support

Extension Version react-bootstrap Version
Latest 2.7.0 (Bootstrap 5.2)
1.0.9 1.6.4 (Bootstrap 4.6)

In VS Code, press Cmd+Shift+P and run Extension: Install Specific Version of Extension... to install a specific version.

๐Ÿ“– Snippets

All snippets start with rb for React-Bootstrap.

There are 806 snippets available for components, imports, examples, and utility CSS classes.

Read more on each below.

Component Snippets

All React-Bootstrap's components are supported.

For example, rb:alert, rb:badge, rb:breadcrumb, etc.

Where applicable, suggestions are made for which components to use inside a given component, such as thead and tbody inside a Table.

Import Snippets

Component import snippets are available for all React-Bootstrap components.

All imports begin with rb:import followed by the component name. For example, rb:import:row will import Row.

Since it's such a common use case, you can also use rb:import:grid to import Container, Row, and Col all at once.

Imports

Individual Import Snippets

According to the docs:

You should import individual components like: react-bootstrap/Button rather than the entire library. Doing so pulls in only the specific components that you use, which can significantly reduce the amount of code you end up sending to the client.

All snippets for individual imports begin with rb:import:only followed by the component name.

For example, rb:import:only:button, rb:import:only:grid, etc.

Example Snippets

Where applicable, examples from the docs are provided as snippets. These can be very helpful as a starting point when working with more complex components, or for use as quick placeholders.

Example snippets all end with -example.

For instance, rb:alert-example will insert an example Alert to build upon.

Examples

Alert and Modal Functions

For convenience, function snippets are included for the show/hide functions needed for modals and dismissible alerts.

Functions

Use rb:modal-functions for the following:

const [showModal, setShowModal] = React.useState(false);
const handleCloseModal = () => setShowModal(false);
const handleShowModal = () => setShowModal(true);

And rb:alert-dismissible-functions for the following:

const [showAlert, setShowAlert] = React.useState(false);
const handleCloseAlert = () => setShowAlert(false);
const handleShowAlert = () => setShowAlert(true);

These pair nicely with the snippets for rb:modal and rb:alert-dismissible.

Table Utilities

This extension includes utilities for tables so you can quickly build table headers and table rows.

Use rb:table-row-X and rb:table-header-row-X, where X is the number of columns from 2-9, to quickly build rows in your thead and tbody.

Tables

Bootstrap Utility CSS Class Snippets

Handy snippets are included for all Bootstrap utility CSS classes.

Use the rb:utils prefix to quickly look up and use any of Bootstrap's utility classes while building.

Utilities

A Note To You, The Developer

My goal was to make this one of the best snippets extensions available to you. As such, I spent countless hours reading the docs to make this as great as I could, and I truly hope you find it useful.

That being said, if you find a bug or see a way to improve this extension, please feel free to open an issue or submit a pull request to the project.

If you found this extension helpful, consider rating it, give it a star โญ๏ธ so others can find it, or buy me a coffee โ˜•๏ธ to show your appreciation.

Happy coding ๐Ÿ––

Release Notes

See the CHANGELOG for release notes.

vscode-react-bootstrap-snippets's People

Contributors

justinmahar avatar yearnsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

yearnsmith

vscode-react-bootstrap-snippets's Issues

Autocomplete does not work inside JSX/HTML tags

Alt Text

Version react-bootstrap-snippets : 2.0.13

Visual StudioCode:
Version: 1.71.2 (user setup)
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Date: 2022-09-14T21:03:37.738Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19044
Sandboxed: No

Visual Studio Markplace: 2.0.13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.