git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on v0.1.1 help sign in
89 lines 2.4 kB history raw
1# purescript-yoga-react-native
3PureScript bindings for React Native macOS with 55+ native AppKit components.
5## Quick Start
7```bash
8# Clone and install
9git clone https://github.com/rowtype-yoga/purescript-yoga-react-native.git
10cd purescript-yoga-react-native
11bun install
12cd example-macos && bun install && cd ..
14# Install CocoaPods
15cd example-macos/macos && bundle exec pod install && cd ../..
17# Build PureScript
18cd example-macos && bunx spago build && cd ..
20# Run the example app
21cd example-macos && npx react-native run-macos
22```
24## Using in Your Project
26Add to `spago.yaml`:
28```yaml
29extraPackages:
30 yoga-react-native:
31 git: https://github.com/rowtype-yoga/purescript-yoga-react-native.git
32 ref: main
33 yoga-react:
34 git: https://github.com/rowtype-yoga/purescript-yoga-react.git
35 ref: main
36```
38```purescript
39import Yoga.React.Native (text, tw, view)
40import Yoga.React.Native.MacOS.Button (nativeButton)
41import Yoga.React.Native.MacOS.Types as T
43myButton = nativeButton
44 { title: "Click me"
45 , bezelStyle: T.push
46 , onPress: handler_ doSomething
47 , style: Style.style { height: 24.0 }
48 }
49```
51## Components
53### Input Controls
54`nativeButton` `nativeSwitch` `nativeSlider` `nativePopUp` `nativeComboBox` `nativeStepper` `nativeDatePicker` `nativeColorWell` `nativeCheckbox` `nativeRadioButton` `nativeSearchField` `nativeTokenField` `nativeSegmented`
56### Text
57`nativeTextField` `nativeTextEditor`
59### Display
60`nativeImage` `nativeAnimatedImage` `nativeVideoPlayer` `nativeLevelIndicator` `nativeProgress` `nativeSeparator` `nativePathControl`
62### Layout
63`nativeBox` `nativeSplitView` `nativeTabView` `nativeScrollView` `sidebarLayout` `nativeToolbar` `nativeVisualEffect` `nativePatternBackground`
65### Overlays
66`macosAlert` `nativeSheet` `nativePopover` `nativeContextMenu` `macosShowMenu`
68### Data Views
69`nativeTableView` `nativeOutlineView`
71### Files & Drag/Drop
72`nativeDropZone` `nativeFilePicker`
74### Rich Media
75`nativeMapView` `nativePDFView` `nativeWebView` `nativeCameraView` `nativeRiveView`
77### System Services
78`copyToClipboard` `macosShare` `macosNotify` `macosPlaySound` `macosSetStatusBarItem` `macosQuickLook` `macosShowColorPanel` `macosShowFontPanel` `say`
80### AI & ML
81`recognizeText` (OCR) `useSpeechRecognition` `detectLanguage` `analyzeSentiment` `tokenize`
83## Prerequisites
85- macOS 14+
86- Xcode 16+
87- Node.js 20+ / Bun
88- PureScript 0.15+ and Spago
89- CocoaPods