Skip to content

Component Library

Paylaşılan UI bileşenleri, Registry Polaris-flat componentleri, Radix UI entegrasyonu ve kullanım örnekleri.

Achidemy projesinde 60+ paylaşılan React bileşeni bulunur. Bileşenler iki ana kaynakta organize edilmiştir:

  1. registry/components/ui/ — Polaris-flat tasarım sistemine uygun, semantic token kullanan modern bileşenler (tercih edilen)
  2. app/components/ — Eski bileşenler ve domain-specific componentler

Polaris-flat tasarım sistemine uygun bileşenler. Bu bileşenler @registry/components/ui/ path alias’ı ile import edilir ve semantic color token’ları kullanır (bg-surface-container-lowest, text-on-surface, border-outline-variant vb.).

// Tercih edilen import yolu
import { Button } from "@registry/components/ui/button";
import { Card, CardContent, CardHeader } from "@registry/components/ui/card";
import { Input } from "@registry/components/ui/input";
ComponentDosyaAçıklama
Buttonbutton.tsxVariant’lar: default, secondary, destructive, ghost. Polaris-flat renk token’ları.
Inputinput.tsxForm input alanı, semantic border/focus stilleri
Textareatextarea.tsxÇok satırlı metin alanı
Selectselect.tsxDropdown seçim bileşeni (Radix UI)
Dialogdialog.tsxModal dialog (Radix UI), DialogHeader, DialogTitle, DialogDescription
Tabstabs.tsxSekme bileşeni (Radix UI)
Accordionaccordion.tsxAçılır/kapanır bölüm (Radix UI)
Cardcard.tsxKart bileşeni: Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter
Labellabel.tsxForm label bileşeni
Checkboxcheckbox.tsxCheckbox input (Radix UI)
Switchswitch.tsxToggle switch, mavi aktif/beyaz pasif tema
Badgebadge.tsxEtiket/badge: default, secondary, destructive, outline variant’ları
Sliderslider.tsxSlider input (Radix UI)
EmptyStateempty-state.tsxEmpty state bileşeni (ikon + başlık + açıklama + aksiyonlar). Detay: EmptyState
Paginationpagination.tsxSayfalama bileşeni
Carouselcarousel.tsxCarousel/slider (Embla Carousel)
Avataravatar.tsxKullanıcı avatar bileşeni (Radix UI)
Tabletable.tsxTablo bileşeni: Table, TableHeader, TableBody, TableRow, TableCell
Skeletonskeleton.tsxLoading skeleton bileşeni
Alertalert.tsxAlert/uyarı bileşeni
Toasttoast.tsxToast bildirimleri (Radix UI)
Code Editorcode-editor.tsxMonaco Editor wrapper
import { Button } from "@registry/components/ui/button";
import { Card, CardContent, CardHeader } from "@registry/components/ui/card";
import { Badge } from "@registry/components/ui/badge";
<Card className="shadow-none border-outline-variant">
<CardHeader className="bg-surface-container-low border-b border-outline-variant">
<h2 className="text-on-surface font-semibold">Başlık</h2>
<Badge variant="outline" className="text-primary bg-secondary-container">
Aktif
</Badge>
</CardHeader>
<CardContent className="p-6">
<p className="text-on-surface-variant">İçerik</p>
<Button className="mt-4">Kaydet</Button>
</CardContent>
</Card>

Eski Radix UI tabanlı bileşenler. Yeni geliştirmelerde @registry/components/ui/ tercih edilmelidir.

ComponentDosyaAçıklama
Buttonui/button.tsxÇoklu variant ve size desteği
Inputui/input.tsxForm input alanı
Textareaui/textarea.tsxÇok satırlı metin alanı
Selectui/select.tsxDropdown seçim bileşeni (Radix UI)
Dialogui/dialog.tsxModal dialog (Radix UI)
Tabsui/tabs.tsxSekme bileşeni (Radix UI)
Accordionui/accordion.tsxAçılır/kapanır bölüm (Radix UI)
Cardui/card.tsxKart bileşeni
Labelui/label.tsxForm label bileşeni
Checkboxui/checkbox.tsxCheckbox input
Switchui/switch.tsxToggle switch
Badgeui/badge.tsxEtiket/badge bileşeni
Sliderui/slider.tsxSlider input
Paginationui/pagination.tsxSayfalama bileşeni
Carouselui/carousel.tsxCarousel/slider bileşeni
Code Editorui/code-editor.tsxMonaco Editor wrapper

Eski Import Yolu (uyumluluk için):

import { Button } from '~/components/ui/button';
import { Input } from '~/components/ui/input';
import { Dialog, DialogContent, DialogTrigger } from '~/components/ui/dialog';

2. Instructor Components (app/components/instructor/)

Section titled “2. Instructor Components (app/components/instructor/)”

Eğitmen paneli için özel bileşenler:

ComponentAçıklama
InstructorSidebarEğitmen paneli yan menü (kurslar, ödemeler, mesajlar, performans)
AcademySidebarAcademy paneli yan menü (dashboard, ayarlar, öğrenciler, builder)
AcademySetupGuideAcademy kurulum rehberi (4 adımlı interaktif rehber, ilerleme takibi)
CourseEditSidebarKurs düzenleme adımları sidebar’ı
QuizAndCodingEditorQuiz ve kodlama egzersizi editörü (geniş UI, Udemy tarzı)
QuizEditorModalQuiz düzenleme modal’ı (soru ekleme/düzenleme)
CodeEditorMonaco Editor tabanlı kod editörü
TestCaseManagerTest case yönetimi (coding exercises için)
RichTextEditorTipTap tabanlı zengin metin editörü
CourseGoalsEditorKurs hedefleri editörü (dnd-kit ile sürükle-bırak)
DirectVideoUploaderBunny TUS protokolü ile doğrudan video yükleme (resumable upload)
PerformanceReviewsChartsRecharts ile performans grafikleri
VideoTranscodingStatusBarBunny video işleme durumu göstergesi

Kullanım:

import InstructorSidebar from '~/components/instructor/InstructorSidebar';
import { QuizAndCodingEditor } from '~/components/instructor/QuizAndCodingEditor';
<InstructorSidebar />

3. Learning Components (app/components/learn/)

Section titled “3. Learning Components (app/components/learn/)”

Öğrenci öğrenme deneyimi bileşenleri:

ComponentAçıklama
CodingWorkspaceKodlama egzersizi çalışma alanı (Monaco Editor + test sonuçları)
QuizPlayerQuiz oynatıcı (soru-cevap, çoktan seçmeli)

Kullanım:

import { CodingWorkspace } from '~/components/learn/CodingWorkspace';
<CodingWorkspace
exercise={exercise}
courseId={courseId}
onComplete={() => {/* egzersiz tamamlandı */}}
/>

4. Course Components (app/components/courses/ ve app/components/)

Section titled “4. Course Components (app/components/courses/ ve app/components/)”

Kurs sayfaları ve keşfet sayfaları için bileşenler:

ComponentDosyaAçıklama
CourseCardapp/components/CourseCard.tsxKurs kartı (thumbnail, başlık, fiyat, rating); grid görünümü.
CourseHorizontalCardapp/components/CourseHorizontalCard.tsxYatay kurs kartı; liste görünümü ve öne çıkan carousel.
CourseSelectionapp/components/CourseSelection.tsxKategori bazlı kurs seçimi (tabs ile).
FilterSidebarapp/components/courses/FilterSidebar.tsxKurs filtreleme sidebar’ı (seviye, dil, süre, fiyat, puan).
BeginnerRecommendationsSectionapp/components/courses/BeginnerRecommendationsSection.tsxBaşlangıç için önerilen kurslar (Popüler / Yeni sekmeleri, grid).
FeaturedCoursesSectionapp/components/courses/FeaturedCoursesSection.tsxÖne çıkan kurslar carousel (1 kart/slide, yatay kart, klavye desteği).
PopularTopicsSectionapp/components/courses/PopularTopicsSection.tsxPopüler konular (5x2 grid, kurs sayısına göre sıralı, konu linkleri).
PopularInstructorsSectionapp/components/courses/PopularInstructorsSection.tsxPopüler eğitmenler (kartlar, public profile link, öğrenci sayısı, eğitmen puanı).
CourseReviewsapp/components/courses/CourseReviews.tsxKurs yorumları listesi.
CourseReviewModalapp/components/courses/CourseReviewModal.tsxYorum yazma modal’ı.
CourseNotesapp/components/courses/CourseNotes.tsxKurs notları bileşeni.
CourseQAapp/components/courses/CourseQA.tsxSoru-cevap bileşeni (video timestamp ile).
CourseSkeletonapp/components/courses/CourseSkeleton.tsxLoading skeleton (kurs kartları için).

Keşfet bölümleri (BeginnerRecommendations, Featured, PopularTopics, PopularInstructors) hem courses.index hem courses.all route’larında “Başlangıç için önerilen kurslar”ın altında sırayla kullanılır. Detay için Kurs Keşfet ve Arama sayfasına bakın.


5. Pricing Components (app/components/pricing/)

Section titled “5. Pricing Components (app/components/pricing/)”

Fiyatlandırma bileşenleri:

ComponentAçıklama
PricingPlansAbonelik planları (aylık/yıllık)
PricingFaqFiyatlandırma SSS

6. Teaching Components (app/components/teaching/)

Section titled “6. Teaching Components (app/components/teaching/)”

Eğitmen ol sayfası bileşenleri:

ComponentAçıklama
InstructorHeroHero section
StepsSectionAdım adım rehber
ReasonsSectionNeden eğitmen ol? bölümü
StatsBarİstatistik çubuğu
TestimonialCarouselMüşteri yorumları carousel
InstructorSupportDestek bölümü

7. Messaging Components (app/components/messages/)

Section titled “7. Messaging Components (app/components/messages/)”

Mesajlaşma bileşenleri:

ComponentAçıklama
ChatInputMesaj giriş alanı (metin, görsel yükleme)

Genel kullanım bileşenleri:

ComponentAçıklama
NavbarAna navigasyon çubuğu (dil seçimi, Algolia anlık arama, kullanıcı menüsü, kategori bar, sepet badge + hover dropdown). Misafir kullanıcı sepet sayısını guest_cart çerezinden okur; “Giriş Yap ve Öde” CTA’sı /:lang/login?intent=checkout ile gelir ve girişten sonra /:lang/cart’a dönerek merge tetiklenir. Detay: Kurs Keşfet ve Arama
FooterFooter bileşeni (sosyal medya, dil seçici, linkler)
NotificationBellBildirim zili dropdown (okunmamış bildirimler, gerçek zamanlı güncelleme)
ErrorBoundaryReact Error Boundary (hata yakalama)
CookieConsentÇerez onayı bileşeni
HeroCarouselAna sayfa hero carousel (Embla Carousel)
CourseSelectionKategori bazlı kurs seçimi (tabs ile)
SkillsSectionYetenekler bölümü (carousel)
AISectionAI özellikleri tanıtım bölümü
PlansSectionPlanlar bölümü
SkeletonLoadersLoading skeleton bileşenleri

Kullanım: class-variance-authority ile variant yönetimi

ui/button.tsx
const buttonVariants = cva(
"base-classes",
{
variants: {
variant: {
default: "...",
destructive: "...",
},
size: {
default: "...",
sm: "...",
},
},
}
);
<Button variant="destructive" size="sm">Sil</Button>

Kullanım: Radix UI primitives ile erişilebilir bileşenler

import * as Dialog from '@radix-ui/react-dialog';
<Dialog.Root>
<Dialog.Trigger>...</Dialog.Trigger>
<Dialog.Content>...</Dialog.Content>
</Dialog.Root>

Kullanım: react-i18next ile çoklu dil desteği

import { useTranslation } from 'react-i18next';
function MyComponent() {
const { t } = useTranslation();
return <h1>{t('common.welcome')}</h1>;
}

Kullanım: Utility-first CSS ile stil yönetimi. Achidemy’de tercihen semantic token class’ları (bg-surface, text-on-surface, border-outline-variant vb.) ve @registry/components/ui bileşenleri kullanılır.

import { Card, CardContent, CardHeader } from "@registry/components/ui/card";
import { Badge } from "@registry/components/ui/badge";
<Card className="shadow-none border-outline-variant">
<CardHeader className="bg-surface-container-low border-b border-outline-variant">
<h3 className="text-on-surface font-semibold">Başlık</h3>
<Badge variant="outline" className="text-primary bg-secondary-container">
Durum
</Badge>
</CardHeader>
<CardContent className="p-5 bg-surface-container-lowest text-on-surface-variant">
Content
</CardContent>
</Card>

interface ComponentProps {
title: string;
description?: string;
onAction?: () => void;
}
export default function Component({ title, description, onAction }: ComponentProps) {
// ...
}
Component.defaultProps = {
description: '',
onAction: () => {},
};

Naming: handle prefix kullanılır

const handleClick = () => {
// ...
};
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
// ...
};
  • ARIA labels: aria-label, aria-describedby
  • Keyboard navigation: tabIndex, onKeyDown
  • Focus management: focus-visible states

  • registry/components/ui/* — Polaris-flat UI componentleri (tercih edilen)
  • app/components/ui/* — Legacy UI primitives
  • app/components/instructor/* — Eğitmen bileşenleri
  • app/components/learn/* — Öğrenme bileşenleri
  • app/components/courses/* — Kurs bileşenleri
  • app/lib/utils.tscn fonksiyonu (className merge)
  • app/app.css — Global stil ve Polaris-flat token tanımları

Tasarım Sistemi: Polaris-flat Tasarım Sistemi
Shadcn UI: Shadcn UI Dokümantasyonu
Radix UI: Radix UI Dokümantasyonu
Tailwind CSS: Tailwind CSS Dokümantasyonu