kliping.pro
  • Docs
  • Directory
  • Colors
  • Typeset
Docs
    • Vite
    • Nuxt
    • Astro
    • Laravel
    • Manual

Astro

PreviousNext

Memasang dan mengonfigurasi Kliping di project Astro.

Buat project ​

Mulai dengan membuat project Astro baru:

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

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 menyiapkan project Anda:

pnpm dlx shadcn-vue@latest init

Tambahkan komponen ​

Sekarang Anda bisa mulai menambahkan komponen ke project.

pnpm dlx shadcn-vue@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
Dirilis di bawah lisensi MIT. Ditulis ulang untuk Vue dari shadcn-vue, shadcn-ui-blocks, dan shadcn-hooks. Hak cipta © 2026 Kliping