React
Set up Tabler in React and build a first working page.
React components render standard HTML, so Tabler works as the styling layer. You write JSX with Tabler classes, and @tabler/core provides the CSS. JavaScript is only needed for interactive components such as dropdowns, modals, and tooltips.
This guide uses a standard Vite-based React setup. You'll install @tabler/core, import its CSS and JS in your entry file, and render a first page with a Tabler card.
Setup
Install Tabler package
Install @tabler/core with your preferred package manager:
npm install @tabler/coreyarn add @tabler/corepnpm install @tabler/corebun install @tabler/coreYou can also use CDN files when you want a quick no-build setup:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/[email protected]/dist/css/tabler.min.css" integrity="sha384-MwEqmM8WBfwWX5LiVzgcxav7Srl1u+b/gBJPodcWJTvwWJ9c7bLJXWhyiWtEqXkQ" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/@tabler/[email protected]/dist/js/tabler.min.js" integrity="sha384-CKrlmuNx52figWamK99uxnpR2acAc72jno6l+yhg0UTAcW+glcS7QsJ1lEApFaY/" crossorigin="anonymous"></script>Import styles
Import Tabler CSS once in your React entry file (src/main.jsx):
import '@tabler/core/dist/css/tabler.min.css'To change Sass variables, compile the SCSS sources instead:
@use '@tabler/core/scss/tabler';Sass alone writes custom properties without the --tblr- prefix, so you also need a PostCSS step. Customize with Sass shows how to set it up.
Import and initialize JavaScript
Tabler JavaScript is required for interactive components such as dropdowns, modals, and tooltips. Import the package once in src/main.jsx:
import '@tabler/core'With a bundler, @tabler/core points to the ES module build (dist/js/tabler.esm.js). Import Tabler's JavaScript from this one entry point only. Don't also import dist/js/tabler.min.js, because that loads a second copy, and every toggle then reacts twice.
The script sets up tooltips, popovers, dropdowns and the Tabler plugins for the markup that exists when it runs. React renders its markup later, so call init() after a component mounts, and dispose() before it unmounts. Do both in useEffect, not during render:
import { useEffect, useRef } from 'react'
import { init, dispose } from '@tabler/core'
export function TooltipExample() {
const ref = useRef(null)
useEffect(() => {
const root = ref.current
init(root)
return () => dispose(root)
}, [])
return (
<div ref={ref}>
<button className="btn" data-bs-toggle="tooltip" title="Example">
Hover me
</button>
</div>
)
}init() only sets up elements that don't have an instance yet, so calling it again is safe. See Markup added after page load for what it covers.
Minimal working example
Create a simple src/main.jsx that loads Tabler assets and renders the app:
import React from 'react'
import ReactDOM from 'react-dom/client'
import '@tabler/core/dist/css/tabler.min.css'
import '@tabler/core'
import App from './App.jsx'
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)Then create src/App.jsx with a minimal Tabler layout and one card:
export default function App() {
return (
<div className="page">
<div className="page-wrapper">
<div className="container-xl py-4">
<div className="card">
<div className="card-body">
<h3 className="card-title">React + Tabler</h3>
<p className="text-secondary mb-0">Your Tabler setup is working.</p>
</div>
</div>
</div>
</div>
</div>
)
}Run the app:
npm run devOpen the local Vite URL and confirm the card is styled with Tabler.
Next steps
- Continue with Customize to adjust styles and build setup.
- Explore Layout to choose page structures.
- Browse Components to add UI building blocks.

