My App
LoopKitFrontend

Components

Pre-styled React components for flashcard interfaces

All components are optional wrappers around LoopKit hooks. Import styles first:

import '@loopkit/react/styles.css';

ReviewSession

Full study session UI with card display, grade buttons, and completion summary.

import { ReviewSession } from '@loopkit/react';

<ReviewSession
    deckId="deck-123"
    onComplete={(summary) => console.log(summary)}
/>
PropTypeDescription
deckIdstringThe deck to study
classNamestring?Additional CSS class names
onComplete(summary: SessionSummary) => voidCalled when session finishes

CardViewer

Displays a card's front and/or back content.

import { CardViewer } from '@loopkit/react';

<CardViewer
    renderedContent={{ front: '<p>Question</p>', back: '<p>Answer</p>' }}
    showBack={false}
/>
PropTypeDescription
renderedContentRenderedCardThe { front, back } HTML strings
showBackbooleanWhether to show the back side
classNamestring?Additional CSS class names

GradeButtons

Grade selection buttons with interval previews.

import { GradeButtons } from '@loopkit/react';

<GradeButtons
    onGrade={(grade) => handleGrade(grade)}
    nextIntervals={{ again: '1m', hard: '6m', good: '10m', easy: '4d' }}
/>
PropTypeDescription
onGrade(grade: Grade) => voidCalled when a grade button is clicked
nextIntervalsRecord<Grade, string>Interval labels for each button
disabledboolean?Disable all grade buttons
classNamestring?Additional CSS class names

SessionComplete

Displays session summary after study is complete.

import { SessionComplete } from '@loopkit/react';

<SessionComplete
    summary={sessionSummary}
    onClose={() => navigate('/decks')}
/>
PropTypeDescription
summarySessionSummarySession results
onClose() => voidCalled when user dismisses
classNamestring?Additional CSS class names

DeckList

Flat list of all decks.

import { DeckList } from '@loopkit/react';

<DeckList onDeckSelect={(deckId) => navigate(`/study/${deckId}`)} />
PropTypeDescription
onDeckSelect(id: string) => voidCalled when a deck is selected
classNamestring?Additional CSS class names

DeckOverview

Overview of a single deck with card counts and a study button.

import { DeckOverview } from '@loopkit/react';

<DeckOverview deckId="deck-123" onStudy={() => startStudy()} />
PropTypeDescription
deckIdstringThe deck to display
onStudy() => voidCalled when study button is clicked
classNamestring?Additional CSS class names

DeckTree

Hierarchical deck browser with collapsible nodes.

import { DeckTree } from '@loopkit/react';

<DeckTree onDeckSelect={(deckId) => navigate(`/decks/${deckId}`)} />
PropTypeDescription
onDeckSelect(id: string) => voidCalled when a deck is selected
classNamestring?Additional CSS class names

CardEditor

Form for creating and editing notes.

import { CardEditor } from '@loopkit/react';

<CardEditor
    noteTypeId="basic-type-id"
    onSave={(note) => console.log('Saved:', note.id)}
/>
PropTypeDescription
noteTypeIdstringNote type for field schema
initialNoteNoteBase?Pre-fill for editing
onSave(note: NoteBase) => voidCalled after successful save
classNamestring?Additional CSS class names

StudyStats

Statistics charts for a deck.

import { StudyStats } from '@loopkit/react';

<StudyStats deckId="deck-123" />
PropTypeDescription
deckIdstringThe deck to show stats for
classNamestring?Additional CSS class names

On this page