API example map
Start with a runnable lesson, then use its linked reference for individual options and methods. This inventory covers the author-facing value exports of react, react-native, @kog/ui, @kog/router, @kog/hardware, expo-audio (@kog/audio), the Expo device-service modules, and the networking globals. Types and compiler-generated internals are not application APIs. An API appearing in an export list does not necessarily mean it is implemented; those cases are identified below.
| API family | Example |
|---|---|
View, Text, StyleSheet.create, flex layout | Hello Kog |
useState, useEffect, Pressable, TouchableOpacity | State and events, Images |
Image, ImageBackground, asset imports, URI sources, load/error lifecycle | Images, including editable modules and PNG bytes |
TextInput, KeyboardAvoidingView, Keyboard, Switch, Slider, Button, Modal, Alert, TouchableHighlight, TouchableWithoutFeedback | Forms and dialogs |
ScrollView, FlatList, SectionList, list refs | Lists; VirtualizedList is the FlatList alias |
Arc, Bar, ProgressBar, Spinner, Checkbox, Dropdown, Roller | Native widgets |
ActivityIndicator | Images, Networking |
Animated, Easing, useAnimatedValue, useInterval, useTimeout | Animation and timers; Animated methods |
createContext, useContext, useReducer, useMemo, useCallback, useRef, useId, useLayoutEffect, useImperativeHandle, forwardRef, memo, findNodeHandle | Context and refs |
Fragment, default React namespace | Hooks reference; fragments group children without adding a native widget |
Appearance, useColorScheme, ThemeProvider, DynamicColor, SafeAreaView, StatusBar, useDisplay, Dimensions, useWindowDimensions, PixelRatio, Platform, AppState, I18nManager, InteractionManager, GestureDirection | Display and theme |
ErrorBoundary | Error recovery |
Router, MemoryRouter, Routes, Route, Outlet, Navigate, Link, NavLink, useNavigate, useParams, useLocation, useNavigationType, useSearchParams, useResolvedPath, useMatch, useInRouterContext | Routing, two interactive examples |
useOutletContext | Router reference; pass the value on Outlet context for the nested route |
useFocusEffect, useIsFocused | Routing |
createPath, parsePath, resolvePath, generatePath, matchPath, matchRoutes, SearchParams, hrefOf | Routing, logged by the second example |
gpio, useButton, useDigitalRead, useDigitalWrite, useAnalogRead, usePWM | Hardware, RGB and discrete LEDs with real GPIO/PWM output observation |
claim, release, digitalRead, digitalWrite, watch, analogRead, adc, pwm, HwError, GPIO_NUM_MAX | Owning hardware resources directly; a runnable example with explicit cleanup |
i2c, spi | Hardware API; real devices need the specified wiring and attached peripheral |
useAudioPlayer, useAudioPlayerStatus, createAudioPlayer, useAudioSampleListener, useAudioRecorder, useAudioRecorderState, RecordingPresets, useAudioPlaylist, useAudioPlaylistStatus, setAudioModeAsync, setIsAudioActiveAsync, AudioModule | Audio API and the examples/audio app (bundled WAV/MP3, SD-card playback, recording); sound needs a board with a speaker, the desktop simulator, or a click in the browser simulator |
expo-battery, expo-brightness, expo-sensors (Accelerometer, Gyroscope), expo-haptics, Vibration, useDevice | Device services; the Studio and docs simulators drive battery and motion from the Device panel and show brightness and the motor. A real board needs the part in its board.yaml |
fetch, Request, Response, Headers, URL, URLSearchParams, AbortController, AbortSignal, TextEncoder, TextDecoder | Networking |
WebSocket, MessageEvent, CloseEvent | WebSocket guide; a reachable WebSocket server is required |
TCPSocket, TCPServer, UDPSocket | TCP and UDP; native simulator or firmware only |
WiFi | Wi-Fi guide; requires native Wi-Fi hardware |
Event, EventTarget, DOMException, btoa, atob, KogNetError, KogNetUnavailableError | Network API, network overview |
Compatibility and implementation limits
These exports are not represented as working features in the runnable lessons:
| API | Current behavior |
|---|---|
Chart | Widget export exists, but series-data transport is unimplemented. data is rejected by the compiler. |
useDevice | battery is the live battery level (-1 without a gauge); heapFree and rssi are still zero. |
DeviceMotion, Magnetometer, MagnetometerUncalibrated, Barometer, LightSensor, Pedometer (expo-sensors) | No board has drivers yet: isAvailableAsync() is false and subscribing throws SENSOR_UNAVAILABLE. |
useAudioStream, AudioStream | Exported so expo code compiles; both throw AUDIO_UNAVAILABLE (real-time PCM capture is not implemented). Record a WAV with useAudioRecorder instead. |
useStorage | In-memory state only; no flash/NVS persistence. Its return value is a mount-time snapshot. Use useState for reactive session state. |
useSyncExternalStore | Subscribes and cleans up, but the returned snapshot is not compiler-lowered into a reactive binding. Use a subscription inside useEffect feeding useState when the UI must update. |
LayoutAnimation | Layout changes apply immediately with a warning; use Animated for visible interpolation. |
Linking, Share, Clipboard, BackHandler | Compatibility exports that throw or reject; Kog has no phone OS services behind them. |
Animated.event, animated arithmetic, color interpolation, Alert.prompt | Unsupported methods that throw. |
StatusBar, AppState transitions, RTL layout | No OS status bar, foreground/background lifecycle, or RTL layout engine. The display lesson shows their actual fixed semantics. |
Lower-level AnimatedValue / AnimatedInterpolation, withGeometry / rectShape, and StyleSheet.flatten / compose share the implementations behind the corresponding high-level lessons; see hooks, styling, and React Native APIs. Prefer the high-level API when it expresses the same behavior.
installNet and sliderScale are runtime integration helpers. Boot installs networking before app code; application code should not reinstall it. Compiler-facing exports such as __style, __text, encodeProp, host builders, and bridge interfaces are deliberately outside this lesson map.