bootstrap-vue、foundation-sites、material-ui、react-bootstrap は、Web アプリケーションの UI 構築を加速するための代表的なライブラリです。material-ui と react-bootstrap は React 専用のコンポーネントライブラリであり、それぞれ Material Design と Bootstrap のデザインシステムをコンポーネントとして提供します。bootstrap-vue は Vue.js 向けに Bootstrap を実装していますが、Vue 2 向けが主流であり Vue 3 への移行には注意が必要です。foundation-sites はフレームワークに依存しない CSS フレームワークであり、レスポンシブグリッドと基本的な UI パターンを提供しますが、他の 3 つに比べるとモダンな JS フレームワークとの統合性は低めです。これらはプロジェクトの技術スタック(React か Vue か、あるいはフレームワークフリーか)とデザイン要件によって選択が分かれます。
Web アプリケーションの開発において、UI フレームワークの選定はプロジェクトの長期メンテナンス性と開発速度に直結する重要な決定です。bootstrap-vue、foundation-sites、material-ui、react-bootstrap はいずれも歴史があり広く使われてきましたが、その技術的アプローチと対象とするスタックは大きく異なります。ここでは、実務的な観点からこれらを比較分析します。
ライブラリを選ぶ際、最初に確認すべきは使用している JS フレームワークとの親和性です。
material-ui は React 専用に設計されています。
// material-ui: React 専用コンポーネント
import Button from '@mui/material/Button';
function MyComponent() {
return <Button variant="contained">Hello World</Button>;
}
react-bootstrap も React 専用に設計されています。
// react-bootstrap: React 専用コンポーネント
import Button from 'react-bootstrap/Button';
function MyComponent() {
return <Button variant="primary">Hello World</Button>;
}
bootstrap-vue は Vue.js 専用に設計されています。
bootstrap-vue-next として別プロジェクトになっています。<!-- bootstrap-vue: Vue 専用コンポーネント -->
<template>
<b-button variant="primary">Hello World</b-button>
</template>
foundation-sites はフレームワークに依存しません。
<!-- foundation-sites: 標準 HTML/CSS -->
<button class="button primary">Hello World</button>
デザインの変更やテーマ適用のしやすさは、プロジェクトの見た目を決定づけます。
material-ui は JS 内でテーマを定義します。
ThemeProvider を使用して、色やタイポグラフィを一元管理できます。sx プロップや styled 関数で個別コンポーネントのスタイルを上書き可能です。// material-ui: テーマと sx プロップ
import { ThemeProvider, createTheme } from '@mui/material/styles';
import Box from '@mui/material/Box';
const theme = createTheme({ palette: { primary: { main: '#ff0000' } } });
// 使用例
<Box sx={{ color: 'primary.main' }}>Themed Text</Box>
react-bootstrap は従来の CSS クラスと併用します。
className プロップを渡して追加スタイルを適用します。// react-bootstrap: className での拡張
import Button from 'react-bootstrap/Button';
// 追加の CSS クラスを適用
<Button variant="primary" className="custom-btn">Styled</Button>
bootstrap-vue も CSS クラスベースです。
<!-- bootstrap-vue: クラスバインディング -->
<template>
<b-button :class="{ 'active': isActive }">Toggle</b-button>
</template>
foundation-sites は Sass 変数によるカスタマイズが中心です。
settings.scss ファイルでグローバルなデザイントークンを定義します。// foundation-sites: Sass 設定
$primary-color: #ff0000;
@import 'foundation';
長期プロジェクトでは、ライブラリのメンテナンス状況が死活問題になります。
material-ui は非常に活発にメンテナンスされています。
react-bootstrap も安定してメンテナンスされています。
bootstrap-vue は注意が必要です。
bootstrap-vue は Vue 2 向けであり、Vue 2 のサポート終了に伴い実質的に開発が停滞しています。bootstrap-vue-next を使う必要がありますが、エコシステムが分断されています。foundation-sites はメンテナンスが続いていますが、勢いは緩やかです。
異なるアプローチを取っていますが、共通する目的と機能もあります。
// material-ui: Grid コンポーネント
<Grid container spacing={2}>
<Grid item xs={6}>Left</Grid>
<Grid item xs={6}>Right</Grid>
</Grid>
// react-bootstrap: Row/Col コンポーネント
<Row>
<Col xs={6}>Left</Col>
<Col xs={6}>Right</Col>
</Row>
<!-- bootstrap-vue: b-container/b-row/b-col -->
<b-container fluid>
<b-row>
<b-col cols="6">Left</b-col>
<b-col cols="6">Right</b-col>
</b-row>
</b-container>
<!-- foundation-sites: grid-x/grid-cell -->
<div class="grid-x grid-padding-x">
<div class="cell small-6">Left</div>
<div class="cell small-6">Right</div>
</div>
material-ui は特にこの点を重視しています。| 特徴 | material-ui | react-bootstrap | bootstrap-vue | foundation-sites |
|---|---|---|---|---|
| 主要フレームワーク | React | React | Vue (2/3) | フレームワークフリー |
| スタイリング | CSS-in-JS (Emotion) | Bootstrap CSS (Sass) | Bootstrap CSS (Sass) | Foundation CSS (Sass) |
| デザイン体系 | Material Design | Bootstrap | Bootstrap | Foundation |
| カスタマイズ | テーマオブジェクト | Sass 変数 | Sass 変数 | Sass 設定ファイル |
| メンテナンス | 活発 | 安定 | 要注意 (Vue 2) | 安定 (緩やか) |
material-ui は、React を使っており、モダンで統一されたデザインシステムを必要とする場合に最適です。特に大規模なエンタープライズアプリケーションや、カスタマイズされたテーマを扱うプロジェクトに適しています。
react-bootstrap は、React を使っており、Bootstrap の見た目や既存の資産を活かしたい場合に最適です。CSS クラスでの制御を好むチームや、Bootstrap のエコシステム(テンプレートなど)を利用したい場合に選ばれます。
bootstrap-vue は、Vue 2 のレガシープロジェクトを維持する場合に限ります。新規で Vue を使う場合は、bootstrap-vue-next や他の Vue 専用ライブラリ(Vuetify など)を検討すべきです。
foundation-sites は、特定の JS フレームワークに依存したくない場合や、CSS 設計に深い関与が必要な場合に適しています。ただし、モダンな SPA 開発においては、React や Vue 用のコンポーネントライブラリを使う方が生産性が高いことが多いです。
最終的なアドバイス:技術スタック(React か Vue か)が最初の決定要因です。その上で、デザイン要件(Material か Bootstrap か)と、カスタマイズの自由度(CSS-in-JS か 伝統的 CSS か)で選択を確定させましょう。
React プロジェクトで、既存の Bootstrap デザインやカスタム CSS をそのまま活用したい場合に選択します。Bootstrap のクラス体系を理解しているチームにとって学習コストが低く、CSS 側での制御を維持しつつ React のコンポーネント機能を使いたい時に適しています。Material Design ではなく、伝統的な Web サイトのルックアンドフィールを維持したい時に選ばれます。
Vue 2 で構築された既存プロジェクトを維持する場合に選択します。ただし、Vue 2 はサポートが終了しているため、新規プロジェクトでの採用は避けるべきです。Vue 3 を使用したい場合は、後継である bootstrap-vue-next の検討を強く推奨します。Bootstrap のデザイン体系を Vue で使いたい場合の伝統的な選択肢ですが、将来性の観点でリスクがあります。
特定の JS フレームワークに縛られず、CSS レベルで設計をコントロールしたい場合に選択します。jQuery や Vanilla JS との相性が良く、独自のデザインシステムを構築するベースとして適しています。React や Vue のコンポーネントライブラリのような豊富な機能は期待できませんが、軽量で柔軟なレイアウト構築には向いています。
React プロジェクトで、Google の Material Design に準拠した一貫性のある UI を迅速に構築したい場合に最適です。テーマカスタマイズ機能が強く、エンタープライズ向けのダッシュボードや複雑なフォームを持つアプリケーションに適しています。コンポーネントの品質とアクセシビリティが高く、大規模なエコシステムを必要とする場合に選択されます。
Bootstrap 5 components built with React.
React-Bootstrap is compatible with various versions of Bootstrap. As such, you need to ensure you are using the correct combination of versions.
See the below table on which version of React-Bootstrap you should be using in your project.
| Bootstrap Version | React-Bootstrap Version | Documentation |
|---|---|---|
| v5.x | 2.x | Link |
| v4.x | 1.x (not maintained) | Link |
| v3.x | 0.33.x (not maintained) | Link |
If you would like to update React-Bootstrap within an existing project to use Bootstrap 5, please read our docs for migrating to React-Bootstrap V2.
If you would like to update React-Bootstrap within an existing project to use Bootstrap 4, please read our docs for migrating to React-Bootstrap V1.
Yarn is our package manager of choice here. Check out setup
instructions here if you don't have it installed already.
After that you can run yarn run bootstrap to install all the needed dependencies.
From there you can:
yarn test (Or run them in watch mode with yarn run tdd).yarn startyarn run buildClick here to explore some React-Bootstrap CodeSandbox examples.
Click here to automatically open CodeSandbox with the React-Bootstrap CodeSandbox Examples GitHub Repository as a workspace.
Yes please! See the contributing guidelines for details.