EmptyState
Polaris-flat çizgisinde reusable empty state bileşeni (ikon + başlık + açıklama + aksiyonlar).
EmptyState, boş liste/boş sonuç/ilk kurulum gibi durumlarda tutarlı bir görünüm sağlar.
Import
Section titled “Import”import { EmptyState } from "@registry/components/ui/empty-state";- title:
string(zorunlu) - description:
string(opsiyonel) - icon:
ReactNode(opsiyonel) - primaryAction:
{ label: string; href: string }veya{ label: string; onClick: () => void } - secondaryAction:
primaryActionile aynı tip - size:
"sm" | "md"(default:md) - className:
string(opsiyonel)
Örnekler
Section titled “Örnekler”Link aksiyonu (href)
Section titled “Link aksiyonu (href)”import { EmptyState } from "@registry/components/ui/empty-state";import { Archive } from "lucide-react";
<EmptyState icon={<Archive className="h-7 w-7" aria-hidden />} title="Arşiv boş" description="Henüz arşivlenmiş bir kursun yok." primaryAction={{ label: "Kurslarıma git", href: "/my-courses" }} className="max-w-md mx-auto"/>;Callback aksiyonu (onClick)
Section titled “Callback aksiyonu (onClick)”import { EmptyState } from "@registry/components/ui/empty-state";import { Plus } from "lucide-react";
<EmptyState icon={<Plus className="h-7 w-7" aria-hidden />} title="Henüz öğe yok" description="İlk öğeni ekleyerek başlayabilirsin." primaryAction={{ label: "Yeni ekle", onClick: () => setOpen(true) }}/>;Kullanıldığı yerler
Section titled “Kullanıldığı yerler”app/routes/instructor._index.tsx→ Deleted Courses (Trash) empty stateapp/routes/my-courses.wishlist.tsx→ Wishlist empty stateapp/routes/my-courses.certifications.tsx→ Certifications empty stateapp/routes/my-courses.archived.tsx→ Archived empty state