kliping.pro
  • Docs
  • Explore
  • Builder
  • Directory
  • Colors
  • Typeset
Saved
Docs
  • Sections13
  • Installation5
  • Vite
  • Nuxt
  • Astro
  • Laravel
  • Manual
  • Dark Mode4
  • Forms3
  • Registry6
  • Utilities2
  • More10
  • Components137
  1. Docs
  2. Installation
  3. Astro

Astro

PreviousNext

Memasang dan mengonfigurasi Kliping di project Astro.

Buat project ​

Mulai dengan membuat project Astro baru memakai tool milik Astro sendiri. Template with-tailwindcss sudah berisi Tailwind CSS v4, dan --add vue memasang integrasi Vue:

pnpm create astro@latest astro-app  --template with-tailwindcss --install --add vue --git

init belum menyiapkan Astro otomatis

Untuk Vite dan Nuxt, kliping init memasang Tailwind CSS dan alias @ sendiri. Untuk Astro belum: Tailwind CSS v4 dan alias @ harus sudah ada sebelum init dijalankan. Template di atas sudah membawa Tailwind; alias-nya Anda tambahkan di langkah berikut. Kalau project Astro Anda dibuat dengan cara lain, ikuti Manual Installation.

Sunting file tsconfig.json ​

Tambahkan kode berikut ke tsconfig.json supaya path bisa diselesaikan dengan benar:

json
{
  "compilerOptions": {
    // ...
    "baseUrl": ".",
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
    // ...
  }
}
1
2
3
4
5
6
7
8
9
10
11
12

Jalankan CLI ​

Jalankan perintah init untuk memasang dasar Kliping (helper cn() beserta dependensinya dan token tema) dan menulis components.json:

pnpm dlx kliping@latest init

Tambahkan komponen ​

Sekarang Anda bisa mulai menambahkan komponen ke project.

pnpm dlx kliping@latest add button

Perintah di atas menambahkan komponen Button ke project Anda. Setelah itu, import seperti ini:

astro
---
import { Button } from "@/components/ui/button"
---

<html lang="en">
	<head>
		<title>Astro</title>
	</head>
	<body>
		<Button>Hello World</Button>
	</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
PreviousNuxtNext Laravel

On This Page

Buat projectSunting file tsconfig.jsonJalankan CLITambahkan komponen

© 2026 Kliping. Free components are open source under the MIT License.

LicenseCreditsRoadmap