git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on main help sign in
WIP: React Native bindings development
commitc5df824cde5a77a5313bc778a566ffe3ae79e466 authorMark <mark.eibes@gmail.com> dateMon 16 Feb 2026, 22:57 (7 months ago) parentded9ba0
8 files changed+27−27
docs/src/Docs/Pages/DataViews.purs+2−2 docs/src/Docs/Pages/Display.purs+1−1 docs/src/Docs/Pages/FilesAndDragDrop.purs+2−2 docs/src/Docs/Pages/InputControls.purs+14−14 docs/src/Docs/Pages/LayoutPage.purs+2−2 docs/src/Docs/Pages/Overlays.purs+1−1 docs/src/Docs/Pages/RichMedia.purs+3−3 docs/src/Docs/Pages/TextEditing.purs+2−2
docs/src/Docs/Pages/DataViews.purs+2−2
@@ -23,7 +23,7 @@ tableView = L.componentDoc "nativeTableView" "Yoga.React.Native.MacOS.TableView
2323 , rows: [ ["file.txt", "4 KB"], ["image.png", "1.2 MB"] ]
2424 , headerVisible: true
2525 , alternatingRows: true
26− , onSelectRow: handler (syntheticEvent >>> \e -> ...)
26+ , onSelectRow: E.onInt "rowIndex" setSelected
2727 }"""
2828 [ propsTable
2929 [ { name: "columns", type_: "Array TableColumn", description: "Column definitions ({ id, title, width })" }
@@ -50,7 +50,7 @@ outlineView = L.componentDoc "nativeOutlineView" "Yoga.React.Native.MacOS.Outlin
5050 }
5151 ]
5252 , headerVisible: true
53− , onSelectItem: handler (syntheticEvent >>> \e -> ...)
53+ , onSelectItem: E.onString "id" setSelected
5454 }"""
5555 [ propsTable
5656 [ { name: "items", type_: "Array OutlineItem", description: "Hierarchical tree data (newtype with { id, title, sfSymbol, children })" }
docs/src/Docs/Pages/Display.purs+1−1
@@ -111,7 +111,7 @@ pathControl = L.componentDoc "nativePathControl" "Yoga.React.Native.MacOS.PathCo
111111 """nativePathControl
112112 { url: "/Users/you/Documents"
113113 , pathStyle: T.standard
114− , onSelectPath: handler (syntheticEvent >>> \e -> ...)
114+ , onSelectPath: E.onString "url" setPath
115115 }"""
116116 [ propsTable
117117 [ { name: "url", type_: "String", description: "File path URL to display" }
docs/src/Docs/Pages/FilesAndDragDrop.purs+2−2
@@ -24,7 +24,7 @@ filePicker = L.componentDoc "nativeFilePicker" "Yoga.React.Native.MacOS.FilePick
2424 , allowedTypes: ["pdf", "txt", "png"]
2525 , allowMultiple: true
2626 , canChooseDirectories: false
27− , onPickFiles: handler (syntheticEvent >>> \e -> ...)
27+ , onPickFiles: E.onStrings "files" setFiles
2828 , onCancel: handler_ (pure unit)
2929 }"""
3030 [ propsTable
@@ -45,7 +45,7 @@ dropZone :: Nut
4545dropZone = L.componentDoc "nativeDropZone" "Yoga.React.Native.MacOS.DropZone (nativeDropZone)"
4646 """-- FFINativeComponent: takes props then children
4747nativeDropZone
48− { onFileDrop: handler (syntheticEvent >>> \e -> ...)
48+ { onFileDrop: E.onStrings "files" setFiles
4949 , onFilesDragEnter: handler_ setDragActive
5050 , onFilesDragExit: handler_ clearDragActive
5151 }
docs/src/Docs/Pages/InputControls.purs+14−14
@@ -47,7 +47,7 @@ switch :: Nut
4747switch = L.componentDoc "nativeSwitch" "Yoga.React.Native.MacOS.Switch (nativeSwitch)"
4848 """nativeSwitch
4949 { on: true
50− , onChange: handler (syntheticEvent >>> \e -> ...)
50+ , onChange: E.onBool "on" setOn
5151 }"""
5252 [ propsTable
5353 [ { name: "on", type_: "Boolean", description: "Current on/off state" }
@@ -61,7 +61,7 @@ slider = L.componentDoc "nativeSlider" "Yoga.React.Native.MacOS.Slider (nativeSl
6161 { value: 50.0
6262 , minValue: 0.0
6363 , maxValue: 100.0
64− , onChange: handler (syntheticEvent >>> \e -> ...)
64+ , onChange: E.onNumber "value" setValue
6565 }"""
6666 [ propsTable
6767 [ { name: "value", type_: "Number", description: "Current value" }
@@ -80,7 +80,7 @@ stepper = L.componentDoc "nativeStepper" "Yoga.React.Native.MacOS.Stepper (nativ
8080 , minValue: 0.0
8181 , maxValue: 10.0
8282 , increment: 1.0
83− , onChange: handler (syntheticEvent >>> \e -> ...)
83+ , onChange: E.onNumber "value" setValue
8484 }"""
8585 [ propsTable
8686 [ { name: "value", type_: "Number", description: "Current value" }
@@ -96,7 +96,7 @@ checkbox = L.componentDoc "nativeCheckbox" "Yoga.React.Native.MacOS.Checkbox (na
9696 """nativeCheckbox
9797 { title: "Enable notifications"
9898 , checked: true
99− , onChange: handler (syntheticEvent >>> \e -> ...)
99+ , onChange: E.onBool "checked" setChecked
100100 }"""
101101 [ propsTable
102102 [ { name: "title", type_: "String", description: "Label text" }
@@ -111,7 +111,7 @@ radioButton = L.componentDoc "nativeRadioButton" "Yoga.React.Native.MacOS.RadioB
111111 """nativeRadioButton
112112 { title: "Option A"
113113 , selected: true
114− , onChange: handler (syntheticEvent >>> \e -> ...)
114+ , onChange: E.onBool "selected" setSelected
115115 }"""
116116 [ propsTable
117117 [ { name: "title", type_: "String", description: "Label text" }
@@ -127,7 +127,7 @@ segmented = L.componentDoc "nativeSegmented" "Yoga.React.Native.MacOS.Segmented
127127 { labels: ["One", "Two", "Three"]
128128 , sfSymbols: ["1.circle", "2.circle", "3.circle"]
129129 , selectedIndex: 0
130− , onChange: handler (syntheticEvent >>> \e -> ...)
130+ , onChange: E.onInt "selectedIndex" setIndex
131131 }"""
132132 [ propsTable
133133 [ { name: "labels", type_: "Array String", description: "Segment labels" }
@@ -142,7 +142,7 @@ popUp = L.componentDoc "nativePopUp" "Yoga.React.Native.MacOS.PopUp (nativePopUp
142142 """nativePopUp
143143 { items: ["Small", "Medium", "Large"]
144144 , selectedIndex: 1
145− , onChange: handler (syntheticEvent >>> \e -> ...)
145+ , onChange: E.onInt "selectedIndex" setIndex
146146 }"""
147147 [ propsTable
148148 [ { name: "items", type_: "Array String", description: "Menu items" }
@@ -157,8 +157,8 @@ comboBox = L.componentDoc "nativeComboBox" "Yoga.React.Native.MacOS.ComboBox (na
157157 { items: ["Apple", "Banana", "Cherry"]
158158 , text: "Apple"
159159 , placeholder: "Choose a fruit..."
160− , onChangeText: handler (syntheticEvent >>> \e -> ...)
161− , onSelectItem: handler (syntheticEvent >>> \e -> ...)
160+ , onChangeText: E.onString "text" setText
161+ , onSelectItem: E.onString "text" setText
162162 }"""
163163 [ propsTable
164164 [ { name: "items", type_: "Array String", description: "Autocomplete suggestions" }
@@ -174,8 +174,8 @@ searchField = L.componentDoc "nativeSearchField" "Yoga.React.Native.MacOS.Search
174174 """nativeSearchField
175175 { placeholder: "Search..."
176176 , text: ""
177− , onChangeText: handler (syntheticEvent >>> \e -> ...)
178− , onSearch: handler (syntheticEvent >>> \e -> ...)
177+ , onChangeText: E.onString "text" setText
178+ , onSearch: E.onString "text" \q -> search q
179179 }"""
180180 [ propsTable
181181 [ { name: "text", type_: "String", description: "Current search text" }
@@ -190,7 +190,7 @@ tokenField = L.componentDoc "nativeTokenField" "Yoga.React.Native.MacOS.TokenFie
190190 """nativeTokenField
191191 { tokens: ["tag1", "tag2"]
192192 , placeholder: "Add tags..."
193− , onChangeTokens: handler (syntheticEvent >>> \e -> ...)
193+ , onChangeTokens: E.onStrings "tokens" setTokens
194194 }"""
195195 [ propsTable
196196 [ { name: "tokens", type_: "Array String", description: "Current tokens" }
@@ -203,7 +203,7 @@ datePicker :: Nut
203203datePicker = L.componentDoc "nativeDatePicker" "Yoga.React.Native.MacOS.DatePicker (nativeDatePicker)"
204204 """nativeDatePicker
205205 { graphical: true
206− , onChange: handler (syntheticEvent >>> \e -> ...)
206+ , onChange: E.onString "date" setDate
207207 }"""
208208 [ propsTable
209209 [ { name: "graphical", type_: "Boolean", description: "Show graphical calendar picker" }
@@ -216,7 +216,7 @@ colorWell = L.componentDoc "nativeColorWell" "Yoga.React.Native.MacOS.ColorWell
216216 """nativeColorWell
217217 { color: "#ff0000"
218218 , minimal: true
219− , onChange: handler (syntheticEvent >>> \e -> ...)
219+ , onChange: E.onString "color" setColor
220220 }"""
221221 [ propsTable
222222 [ { name: "color", type_: "String", description: "Current color hex value" }
docs/src/Docs/Pages/LayoutPage.purs+2−2
@@ -63,7 +63,7 @@ tabView = L.componentDoc "nativeTabView" "Yoga.React.Native.MacOS.TabView (nativ
6363 , { id: "advanced", label: "Advanced" }
6464 ]
6565 , selectedItem: "general"
66− , onSelectTab: handler (syntheticEvent >>> \e -> ...)
66+ , onSelectTab: E.onString "tabId" setTab
6767 }"""
6868 [ propsTable
6969 [ { name: "items", type_: "Array TabItem", description: "Tab items ({ id :: String, label :: String })" }
@@ -116,7 +116,7 @@ toolbar = L.componentDoc "nativeToolbar" "Yoga.React.Native.MacOS.Toolbar (nativ
116116 , selectedItem: "add"
117117 , toolbarStyle: T.unified
118118 , windowTitle: "My App"
119− , onSelectItem: handler (syntheticEvent >>> \e -> ...)
119+ , onSelectItem: E.onString "itemId" setItem
120120 }"""
121121 [ propsTable
122122 [ { name: "items", type_: "Array ToolbarItem", description: "Toolbar items ({ id, label, sfSymbol })" }
docs/src/Docs/Pages/Overlays.purs+1−1
@@ -77,7 +77,7 @@ nativeContextMenu
7777 [ { id: "copy", title: "Copy", sfSymbol: "doc.on.doc" }
7878 , { id: "paste", title: "Paste", sfSymbol: "doc.on.clipboard" }
7979 ]
80− , onSelectItem: handler (syntheticEvent >>> \e -> ...)
80+ , onSelectItem: E.onString "itemId" setSelected
8181 }
8282 [ rightClickTarget ]"""
8383 [ propsTable
docs/src/Docs/Pages/RichMedia.purs+3−3
@@ -33,7 +33,7 @@ mapView = L.componentDoc "nativeMapView" "Yoga.React.Native.MacOS.MapView (nativ
3333 , subtitle: "CA"
3434 }
3535 ]
36− , onRegionChange: handler (syntheticEvent >>> \e -> ...)
36+ , onRegionChange: E.onNumber "latitude" setLat
3737 }"""
3838 [ propsTable
3939 [ { name: "latitude", type_: "Number", description: "Center latitude" }
@@ -54,7 +54,7 @@ pdfView = L.componentDoc "nativePDFView" "Yoga.React.Native.MacOS.PDFView (nativ
5454 { source: "/path/to/document.pdf"
5555 , autoScales: true
5656 , displayMode: T.singlePage
57− , onPageChange: handler (syntheticEvent >>> \e -> ...)
57+ , onPageChange: E.onInt "page" setPage
5858 }"""
5959 [ propsTable
6060 [ { name: "source", type_: "String", description: "PDF file path or URL" }
@@ -68,7 +68,7 @@ webView :: Nut
6868webView = L.componentDoc "nativeWebView" "Yoga.React.Native.MacOS.WebView (nativeWebView)"
6969 """nativeWebView
7070 { url: "https://purescript.org"
71− , onNavigate: handler (syntheticEvent >>> \e -> ...)
71+ , onNavigate: E.onString "url" setUrl
7272 , onFinishLoad: handler_ onPageLoaded
7373 }"""
7474 [ propsTable
docs/src/Docs/Pages/TextEditing.purs+2−2
@@ -19,7 +19,7 @@ textField = L.componentDoc "nativeTextField" "Yoga.React.Native.MacOS.TextField
1919 { text: "Hello"
2020 , placeholder: "Enter text..."
2121 , secure: false
22− , onChangeText: handler (syntheticEvent >>> \e -> ...)
22+ , onChangeText: E.onString "text" setText
2323 , onSubmit: handler_ doSubmit
2424 }"""
2525 [ propsTable
@@ -39,7 +39,7 @@ textEditor = L.componentDoc "nativeTextEditor" "Yoga.React.Native.MacOS.TextEdit
3939 { text: "Rich text content..."
4040 , richText: true
4141 , showsRuler: false
42− , onChangeText: handler (syntheticEvent >>> \e -> ...)
42+ , onChangeText: E.onString "text" setText
4343 }"""
4444 [ propsTable
4545 [ { name: "text", type_: "String", description: "Current text content" }