Astro
Set up Tabler in Astro and build a first working page.
Astro ships zero JavaScript by default, and that suits Tabler. Most Tabler components are pure CSS. The interactive ones need a single script, which Astro bundles and runs only in the browser.
You'll install @tabler/core, import its CSS in a base layout, add the client script, 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 need a quick 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 the frontmatter of your base layout (src/layouts/Layout.astro):
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.
In Astro, a plain <script> tag in an Astro component is bundled and runs only in the browser. That makes it a safe place to import tabler.min.js, because the script never executes during server-side rendering:
<script>
import '@tabler/core/dist/js/tabler.min.js'
</script>Minimal working example
Create a base layout in src/layouts/Layout.astro that loads Tabler CSS and JavaScript:
---
import '@tabler/core/dist/css/tabler.min.css'
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Astro + Tabler</title>
</head>
<body>
<slot />
<script>
import '@tabler/core/dist/js/tabler.min.js'
</script>
</body>
</html>Then add a minimal page in src/pages/index.astro:
---
import Layout from '../layouts/Layout.astro'
---
<Layout>
<div class="page">
<div class="page-wrapper">
<div class="container-xl py-4">
<div class="card">
<div class="card-body">
<h3 class="card-title">Astro + Tabler</h3>
<p class="text-secondary mb-0">Your Tabler setup is working.</p>
</div>
</div>
</div>
</div>
</div>
</Layout>Run the app:
npm run devOpen the local Astro 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.

