Skip to content

Component Library

Paylaşılan UI bileşenleri, Radix UI entegrasyonu, component kategorileri ve kullanım örnekleri.

Achidemy projesinde 56+ paylaşılan React bileşeni bulunur. Bu bileşenler app/components/ klasöründe organize edilmiştir ve Radix UI, Tailwind CSS ve custom utility fonksiyonları kullanır.

Radix UI tabanlı temel bileşenler:

ComponentDosyaAçıklama
Buttonui/button.tsxÇoklu variant ve size desteği (default, destructive, outline, secondary, ghost, link)
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)
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

Kullanım Örneği:

import { Button } from '~/components/ui/button';
import { Input } from '~/components/ui/input';
import { Dialog, DialogContent, DialogTrigger } from '~/components/ui/dialog';
<Button variant="default" size="lg">
Kaydet
</Button>
<Input type="email" placeholder="E-posta" />
<Dialog>
<DialogTrigger>Aç</DialogTrigger>
<DialogContent>
İçerik
</DialogContent>
</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)
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

<div className="flex items-center gap-2 p-4 bg-white rounded-lg shadow-md">
Content
</div>

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

  • app/components/ui/* — 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)

Shadcn UI geliştirmeleri ve daha fazla bilgi için: Shadcn UI Dokümantasyonu
Radix UI geliştirmeleri ve daha fazla bilgi için: Radix UI Dokümantasyonu
Tailwind CSS geliştirmeleri ve daha fazla bilgi için: Tailwind CSS Dokümantasyonu