Install
Install Idea React from an NPM ecosystem package manager and load Bootstrap's CSS from either jsDelivr or unpkg.
Install
Add Idea React and its React and MobX peer dependencies to your project:
npm install idea-react@next react react-dom mobx mobx-react
Equivalent commands are available for other NPM ecosystem package managers:
pnpm add idea-react@next react react-dom mobx mobx-react
yarn add idea-react@next react react-dom mobx mobx-react
bun add idea-react@next react react-dom mobx mobx-react
The current prerelease is published on the next dist-tag. After a stable release, install
idea-react without @next. React and React DOM render the components; MobX and MobX React are
required by stateful components. CodeBlock and LiveTSX also require the
react-element-to-jsx-string peer dependency.
Import components from the package's public entry point:
import { FC } from 'react';
import { Button } from 'idea-react';
export const SaveButton: FC = () => (
<Button variant="solid" theme="primary">
Save
</Button>
);
CDN
Use the version-pinned Bootstrap stylesheet from either supported CDN provider. Bootstrap's CSS provides the design tokens and styles used by Idea React; the component package's stylesheet adds its own component styles. Bootstrap's JavaScript bundle is not required.
| Provider | Stylesheet |
|---|---|
| jsDelivr | bootstrap.min.css |
| unpkg | bootstrap.min.css |
Add Bootstrap, Bootstrap Icons, and Idea React styles to the document <head>:
<link
rel="stylesheet"
href="https://unpkg.com/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="https://unpkg.com/bootstrap-icons@1.13.2/font/bootstrap-icons.css" />
<link rel="stylesheet" href="https://unpkg.com/idea-react@next/dist/index.css" />
Keep the Bootstrap CSS version aligned with the version supported by Idea React. If you choose jsDelivr instead, use the same Bootstrap version and change the stylesheet URL to the jsDelivr entry in the table.