--- title: React order: 2 summary: Set up Tabler in React and build a first working page. description: Install Tabler in React - import the CSS and JS from the @tabler/core package and render a minimal page layout with a Tabler card. icon: brand-react seoDescription: Install `@tabler/core`, import CSS and JS in React, and render a minimal page layout with a Tabler card. --- import TabsPackage from '@components/TabsPackage.astro' import CdnImportPackage from '@components/CdnImportPackage.astro' import Steps from '@components/Steps.astro' React components render standard HTML, so Tabler slots in 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 will 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: You can also use CDN files when you want a quick no-build setup: ### Import styles Import Tabler CSS once in your React entry file (`src/main.jsx`): ```jsx import '@tabler/core/dist/css/tabler.min.css' ``` For full theme customization, import SCSS sources instead: ```scss @use '@tabler/core/scss/tabler'; ``` ### Import and initialize JavaScript Tabler JavaScript is required for interactive components such as dropdowns, modals, and tooltips. Import it once in `src/main.jsx`: ```jsx import '@tabler/core/dist/js/tabler.min.js' ``` React-specific note: do not initialize DOM-based behavior during render. Use `useEffect`: ```jsx import { useEffect } from 'react' import { Tooltip } from '@tabler/core' export function TooltipExample() { useEffect(() => { // Run DOM initialization only after the component is mounted. const elements = document.querySelectorAll('[data-bs-toggle="tooltip"]') elements.forEach((element) => new Tooltip(element)) }, []) return ( ) } ``` ### Minimal working example Create a simple `src/main.jsx` that loads Tabler assets and renders the app: ```jsx import React from 'react' import ReactDOM from 'react-dom/client' import '@tabler/core/dist/css/tabler.min.css' import '@tabler/core/dist/js/tabler.min.js' import App from './App.jsx' ReactDOM.createRoot(document.getElementById('root')).render( , ) ``` Then create `src/App.jsx` with a minimal Tabler layout and one card: ```jsx export default function App() { return (

React + Tabler

Your Tabler setup is working.

) } ``` Run the app: ```shell npm run dev ``` Open the local Vite URL and confirm the card is styled with Tabler. ### Next steps - Continue with [Customize](/ui/getting-started/customize) to adjust styles and build setup. - Explore [Layout](/ui/layout) to choose page structures. - Browse [Components](/ui/components) to add UI building blocks.