@idealyst/mcp-server 1.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +202 -0
  2. package/dist/data/cli-commands.d.ts +2 -0
  3. package/dist/data/cli-commands.d.ts.map +1 -0
  4. package/dist/data/cli-commands.js +100 -0
  5. package/dist/data/cli-commands.js.map +1 -0
  6. package/dist/data/components/Accordion.d.ts +15 -0
  7. package/dist/data/components/Accordion.d.ts.map +1 -0
  8. package/dist/data/components/Accordion.js +112 -0
  9. package/dist/data/components/Accordion.js.map +1 -0
  10. package/dist/data/components/ActivityIndicator.d.ts +15 -0
  11. package/dist/data/components/ActivityIndicator.d.ts.map +1 -0
  12. package/dist/data/components/ActivityIndicator.js +82 -0
  13. package/dist/data/components/ActivityIndicator.js.map +1 -0
  14. package/dist/data/components/Alert.d.ts +15 -0
  15. package/dist/data/components/Alert.d.ts.map +1 -0
  16. package/dist/data/components/Alert.js +132 -0
  17. package/dist/data/components/Alert.js.map +1 -0
  18. package/dist/data/components/Avatar.d.ts +15 -0
  19. package/dist/data/components/Avatar.d.ts.map +1 -0
  20. package/dist/data/components/Avatar.js +93 -0
  21. package/dist/data/components/Avatar.js.map +1 -0
  22. package/dist/data/components/Badge.d.ts +15 -0
  23. package/dist/data/components/Badge.d.ts.map +1 -0
  24. package/dist/data/components/Badge.js +64 -0
  25. package/dist/data/components/Badge.js.map +1 -0
  26. package/dist/data/components/Breadcrumb.d.ts +15 -0
  27. package/dist/data/components/Breadcrumb.d.ts.map +1 -0
  28. package/dist/data/components/Breadcrumb.js +96 -0
  29. package/dist/data/components/Breadcrumb.js.map +1 -0
  30. package/dist/data/components/Button.d.ts +15 -0
  31. package/dist/data/components/Button.d.ts.map +1 -0
  32. package/dist/data/components/Button.js +87 -0
  33. package/dist/data/components/Button.js.map +1 -0
  34. package/dist/data/components/Card.d.ts +15 -0
  35. package/dist/data/components/Card.d.ts.map +1 -0
  36. package/dist/data/components/Card.js +67 -0
  37. package/dist/data/components/Card.js.map +1 -0
  38. package/dist/data/components/Checkbox.d.ts +15 -0
  39. package/dist/data/components/Checkbox.d.ts.map +1 -0
  40. package/dist/data/components/Checkbox.js +118 -0
  41. package/dist/data/components/Checkbox.js.map +1 -0
  42. package/dist/data/components/Chip.d.ts +15 -0
  43. package/dist/data/components/Chip.d.ts.map +1 -0
  44. package/dist/data/components/Chip.js +76 -0
  45. package/dist/data/components/Chip.js.map +1 -0
  46. package/dist/data/components/Dialog.d.ts +15 -0
  47. package/dist/data/components/Dialog.d.ts.map +1 -0
  48. package/dist/data/components/Dialog.js +137 -0
  49. package/dist/data/components/Dialog.js.map +1 -0
  50. package/dist/data/components/Divider.d.ts +15 -0
  51. package/dist/data/components/Divider.d.ts.map +1 -0
  52. package/dist/data/components/Divider.js +71 -0
  53. package/dist/data/components/Divider.js.map +1 -0
  54. package/dist/data/components/Icon.d.ts +15 -0
  55. package/dist/data/components/Icon.d.ts.map +1 -0
  56. package/dist/data/components/Icon.js +70 -0
  57. package/dist/data/components/Icon.js.map +1 -0
  58. package/dist/data/components/Image.d.ts +15 -0
  59. package/dist/data/components/Image.d.ts.map +1 -0
  60. package/dist/data/components/Image.js +122 -0
  61. package/dist/data/components/Image.js.map +1 -0
  62. package/dist/data/components/Input.d.ts +15 -0
  63. package/dist/data/components/Input.d.ts.map +1 -0
  64. package/dist/data/components/Input.js +109 -0
  65. package/dist/data/components/Input.js.map +1 -0
  66. package/dist/data/components/List.d.ts +15 -0
  67. package/dist/data/components/List.d.ts.map +1 -0
  68. package/dist/data/components/List.js +113 -0
  69. package/dist/data/components/List.js.map +1 -0
  70. package/dist/data/components/Menu.d.ts +15 -0
  71. package/dist/data/components/Menu.d.ts.map +1 -0
  72. package/dist/data/components/Menu.js +132 -0
  73. package/dist/data/components/Menu.js.map +1 -0
  74. package/dist/data/components/Popover.d.ts +15 -0
  75. package/dist/data/components/Popover.d.ts.map +1 -0
  76. package/dist/data/components/Popover.js +159 -0
  77. package/dist/data/components/Popover.js.map +1 -0
  78. package/dist/data/components/Pressable.d.ts +15 -0
  79. package/dist/data/components/Pressable.d.ts.map +1 -0
  80. package/dist/data/components/Pressable.js +125 -0
  81. package/dist/data/components/Pressable.js.map +1 -0
  82. package/dist/data/components/Progress.d.ts +15 -0
  83. package/dist/data/components/Progress.d.ts.map +1 -0
  84. package/dist/data/components/Progress.js +95 -0
  85. package/dist/data/components/Progress.js.map +1 -0
  86. package/dist/data/components/RadioButton.d.ts +15 -0
  87. package/dist/data/components/RadioButton.d.ts.map +1 -0
  88. package/dist/data/components/RadioButton.js +140 -0
  89. package/dist/data/components/RadioButton.js.map +1 -0
  90. package/dist/data/components/SVGImage.d.ts +15 -0
  91. package/dist/data/components/SVGImage.d.ts.map +1 -0
  92. package/dist/data/components/SVGImage.js +112 -0
  93. package/dist/data/components/SVGImage.js.map +1 -0
  94. package/dist/data/components/Screen.d.ts +15 -0
  95. package/dist/data/components/Screen.d.ts.map +1 -0
  96. package/dist/data/components/Screen.js +99 -0
  97. package/dist/data/components/Screen.js.map +1 -0
  98. package/dist/data/components/Select.d.ts +15 -0
  99. package/dist/data/components/Select.d.ts.map +1 -0
  100. package/dist/data/components/Select.js +146 -0
  101. package/dist/data/components/Select.js.map +1 -0
  102. package/dist/data/components/Skeleton.d.ts +15 -0
  103. package/dist/data/components/Skeleton.d.ts.map +1 -0
  104. package/dist/data/components/Skeleton.js +110 -0
  105. package/dist/data/components/Skeleton.js.map +1 -0
  106. package/dist/data/components/Slider.d.ts +15 -0
  107. package/dist/data/components/Slider.d.ts.map +1 -0
  108. package/dist/data/components/Slider.js +129 -0
  109. package/dist/data/components/Slider.js.map +1 -0
  110. package/dist/data/components/Switch.d.ts +15 -0
  111. package/dist/data/components/Switch.d.ts.map +1 -0
  112. package/dist/data/components/Switch.js +127 -0
  113. package/dist/data/components/Switch.js.map +1 -0
  114. package/dist/data/components/TabBar.d.ts +15 -0
  115. package/dist/data/components/TabBar.d.ts.map +1 -0
  116. package/dist/data/components/TabBar.js +145 -0
  117. package/dist/data/components/TabBar.js.map +1 -0
  118. package/dist/data/components/Table.d.ts +15 -0
  119. package/dist/data/components/Table.d.ts.map +1 -0
  120. package/dist/data/components/Table.js +151 -0
  121. package/dist/data/components/Table.js.map +1 -0
  122. package/dist/data/components/Tabs.d.ts +15 -0
  123. package/dist/data/components/Tabs.d.ts.map +1 -0
  124. package/dist/data/components/Tabs.js +150 -0
  125. package/dist/data/components/Tabs.js.map +1 -0
  126. package/dist/data/components/Text.d.ts +15 -0
  127. package/dist/data/components/Text.d.ts.map +1 -0
  128. package/dist/data/components/Text.js +85 -0
  129. package/dist/data/components/Text.js.map +1 -0
  130. package/dist/data/components/TextArea.d.ts +15 -0
  131. package/dist/data/components/TextArea.d.ts.map +1 -0
  132. package/dist/data/components/TextArea.js +155 -0
  133. package/dist/data/components/TextArea.js.map +1 -0
  134. package/dist/data/components/Tooltip.d.ts +15 -0
  135. package/dist/data/components/Tooltip.d.ts.map +1 -0
  136. package/dist/data/components/Tooltip.js +105 -0
  137. package/dist/data/components/Tooltip.js.map +1 -0
  138. package/dist/data/components/Video.d.ts +15 -0
  139. package/dist/data/components/Video.d.ts.map +1 -0
  140. package/dist/data/components/Video.js +168 -0
  141. package/dist/data/components/Video.js.map +1 -0
  142. package/dist/data/components/View.d.ts +15 -0
  143. package/dist/data/components/View.d.ts.map +1 -0
  144. package/dist/data/components/View.js +126 -0
  145. package/dist/data/components/View.js.map +1 -0
  146. package/dist/data/components/index.d.ts +37 -0
  147. package/dist/data/components/index.d.ts.map +1 -0
  148. package/dist/data/components/index.js +110 -0
  149. package/dist/data/components/index.js.map +1 -0
  150. package/dist/data/framework-guides.d.ts +2 -0
  151. package/dist/data/framework-guides.d.ts.map +1 -0
  152. package/dist/data/framework-guides.js +589 -0
  153. package/dist/data/framework-guides.js.map +1 -0
  154. package/dist/data/icon-guide.d.ts +2 -0
  155. package/dist/data/icon-guide.d.ts.map +1 -0
  156. package/dist/data/icon-guide.js +285 -0
  157. package/dist/data/icon-guide.js.map +1 -0
  158. package/dist/data/icons.json +7452 -0
  159. package/dist/data/navigation-guides.d.ts +2 -0
  160. package/dist/data/navigation-guides.d.ts.map +1 -0
  161. package/dist/data/navigation-guides.js +1196 -0
  162. package/dist/data/navigation-guides.js.map +1 -0
  163. package/dist/index.d.ts +3 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js +422 -0
  166. package/dist/index.js.map +1 -0
  167. package/package.json +34 -0
  168. package/src/data/cli-commands.ts +103 -0
  169. package/src/data/components/Accordion.ts +106 -0
  170. package/src/data/components/ActivityIndicator.ts +82 -0
  171. package/src/data/components/Alert.ts +132 -0
  172. package/src/data/components/Avatar.ts +93 -0
  173. package/src/data/components/Badge.ts +63 -0
  174. package/src/data/components/Breadcrumb.ts +94 -0
  175. package/src/data/components/Button.ts +86 -0
  176. package/src/data/components/Card.ts +67 -0
  177. package/src/data/components/Checkbox.ts +117 -0
  178. package/src/data/components/Chip.ts +93 -0
  179. package/src/data/components/Dialog.ts +136 -0
  180. package/src/data/components/Divider.ts +70 -0
  181. package/src/data/components/Icon.ts +70 -0
  182. package/src/data/components/Image.ts +121 -0
  183. package/src/data/components/Input.ts +150 -0
  184. package/src/data/components/List.ts +103 -0
  185. package/src/data/components/Menu.ts +125 -0
  186. package/src/data/components/Popover.ts +159 -0
  187. package/src/data/components/Pressable.ts +123 -0
  188. package/src/data/components/Progress.ts +95 -0
  189. package/src/data/components/RadioButton.ts +130 -0
  190. package/src/data/components/SVGImage.ts +114 -0
  191. package/src/data/components/Screen.ts +103 -0
  192. package/src/data/components/Select.ts +140 -0
  193. package/src/data/components/Skeleton.ts +102 -0
  194. package/src/data/components/Slider.ts +150 -0
  195. package/src/data/components/Switch.ts +127 -0
  196. package/src/data/components/TabBar.ts +142 -0
  197. package/src/data/components/Table.ts +153 -0
  198. package/src/data/components/Tabs.ts +152 -0
  199. package/src/data/components/Text.ts +85 -0
  200. package/src/data/components/TextArea.ts +155 -0
  201. package/src/data/components/Tooltip.ts +105 -0
  202. package/src/data/components/Video.ts +168 -0
  203. package/src/data/components/View.ts +126 -0
  204. package/src/data/components/index.ts +109 -0
  205. package/src/data/framework-guides.ts +593 -0
  206. package/src/data/icon-guide.ts +284 -0
  207. package/src/data/icons.json +7452 -0
  208. package/src/data/navigation-guides.ts +1199 -0
  209. package/src/index.ts +473 -0
  210. package/test-client.js +86 -0
  211. package/tsconfig.json +20 -0
@@ -0,0 +1,1199 @@
1
+ export const navigationGuides: Record<string, string> = {
2
+ "idealyst://navigation/overview": `# Navigation System Overview
3
+
4
+ The Idealyst navigation system provides a unified API for both React Native and web applications, handling routing seamlessly across platforms.
5
+
6
+ ## Core Concepts
7
+
8
+ ### Cross-Platform Routing
9
+ - **Mobile (React Native)**: Uses React Navigation for native navigation patterns
10
+ - **Web**: Uses React Router for browser-based routing
11
+ - **Unified API**: Same code works on both platforms
12
+
13
+ ### Route Types
14
+
15
+ There are two fundamental route types:
16
+
17
+ #### 1. Screen Routes
18
+ Renders a component directly to the screen:
19
+ \`\`\`tsx
20
+ {
21
+ path: "profile",
22
+ type: 'screen',
23
+ component: ProfileScreen
24
+ }
25
+ \`\`\`
26
+
27
+ #### 2. Navigator Routes
28
+ Wraps child routes with navigation structure:
29
+ \`\`\`tsx
30
+ {
31
+ path: "/",
32
+ type: 'navigator',
33
+ layout: 'stack', // or 'tab', 'drawer', 'modal'
34
+ routes: [
35
+ { path: "home", type: 'screen', component: HomeScreen },
36
+ { path: "settings", type: 'screen', component: SettingsScreen },
37
+ ]
38
+ }
39
+ \`\`\`
40
+
41
+ ## Setup
42
+
43
+ ### Basic Setup
44
+
45
+ \`\`\`tsx
46
+ import { NavigatorProvider } from '@idealyst/navigation';
47
+
48
+ function App() {
49
+ return (
50
+ <NavigatorProvider route={appRouter}>
51
+ {/* Content managed by router */}
52
+ </NavigatorProvider>
53
+ );
54
+ }
55
+ \`\`\`
56
+
57
+ ### Quick Start with Examples
58
+
59
+ Use pre-built example routers for instant working navigation:
60
+
61
+ \`\`\`tsx
62
+ import { ExampleStackRouter } from '@idealyst/navigation/examples';
63
+
64
+ <NavigatorProvider route={ExampleStackRouter} />
65
+ \`\`\`
66
+
67
+ Available example routers:
68
+ - **ExampleStackRouter**: Desktop/web with header and sidebar
69
+ - **ExampleTabRouter**: Mobile with tab navigation
70
+ - **ExampleDrawerRouter**: Desktop with drawer menu
71
+
72
+ ## Platform Differences
73
+
74
+ ### Mobile (React Native)
75
+ - Stack navigator: Native stack navigation with animations
76
+ - Tab navigator: Bottom tab bar
77
+ - Drawer navigator: Side drawer with gestures
78
+ - Modal navigator: Full-screen modal presentation
79
+
80
+ ### Web
81
+ - Stack navigator: Browser history-based routing
82
+ - Tab navigator: Top or side tab navigation
83
+ - All navigators: Use URL paths for routing
84
+ - Custom layouts: Can add headers, sidebars, footers
85
+
86
+ ## Key Features
87
+
88
+ 1. **Type-Safe Navigation**: Full TypeScript support
89
+ 2. **Path Parameters**: \`/user/:id\` support
90
+ 3. **Nested Routes**: Unlimited nesting depth
91
+ 4. **Custom Layouts**: Web-specific layout components
92
+ 5. **Theme Integration**: Works with @idealyst/theme
93
+ 6. **Cross-Platform**: Write once, run everywhere
94
+ `,
95
+
96
+ "idealyst://navigation/route-configuration": `# Route Configuration
97
+
98
+ Learn how to define and structure routes in your Idealyst application.
99
+
100
+ ## Route Definition
101
+
102
+ ### Screen Route
103
+
104
+ The simplest route type - renders a component:
105
+
106
+ \`\`\`tsx
107
+ import { RouteParam } from '@idealyst/navigation';
108
+
109
+ const route: RouteParam = {
110
+ path: "profile",
111
+ type: 'screen',
112
+ component: ProfileScreen,
113
+ options: {
114
+ title: "User Profile",
115
+ headerShown: true
116
+ }
117
+ };
118
+ \`\`\`
119
+
120
+ ### Navigator Route
121
+
122
+ A route that contains child routes:
123
+
124
+ \`\`\`tsx
125
+ const route: RouteParam = {
126
+ path: "/",
127
+ type: 'navigator',
128
+ layout: 'stack',
129
+ routes: [
130
+ { path: "home", type: 'screen', component: HomeScreen },
131
+ { path: "about", type: 'screen', component: AboutScreen },
132
+ ],
133
+ options: {
134
+ headerShown: false
135
+ }
136
+ };
137
+ \`\`\`
138
+
139
+ ## Path Configuration
140
+
141
+ ### Basic Paths
142
+
143
+ \`\`\`tsx
144
+ { path: "home", ... } // Relative: /parent/home
145
+ { path: "/home", ... } // Absolute: /home
146
+ { path: "", ... } // Index route
147
+ \`\`\`
148
+
149
+ ### Path Parameters
150
+
151
+ \`\`\`tsx
152
+ {
153
+ path: "user/:id",
154
+ type: 'screen',
155
+ component: UserScreen
156
+ }
157
+
158
+ // Navigate with:
159
+ navigator.navigate({
160
+ path: "/user/:id",
161
+ vars: { id: "123" }
162
+ });
163
+
164
+ // Access in component:
165
+ const navigator = useNavigator();
166
+ const userId = navigator.vars.id;
167
+ \`\`\`
168
+
169
+ ### Optional Parameters
170
+
171
+ \`\`\`tsx
172
+ { path: "search/:query?" } // query is optional
173
+ \`\`\`
174
+
175
+ ## Screen Options
176
+
177
+ ### Common Options
178
+
179
+ \`\`\`tsx
180
+ type ScreenOptions = {
181
+ title?: string; // Screen title
182
+ headerShown?: boolean; // Show/hide header (mobile)
183
+ };
184
+ \`\`\`
185
+
186
+ ### Tab-Specific Options
187
+
188
+ For tab navigators:
189
+
190
+ \`\`\`tsx
191
+ type TabBarScreenOptions = {
192
+ tabBarIcon?: (props: {
193
+ focused: boolean;
194
+ color: string;
195
+ size: string | number
196
+ }) => React.ReactElement;
197
+
198
+ tabBarLabel?: string; // Tab label
199
+ tabBarBadge?: string | number; // Badge count
200
+ tabBarVisible?: boolean; // Show/hide tab
201
+ } & ScreenOptions;
202
+ \`\`\`
203
+
204
+ Example:
205
+ \`\`\`tsx
206
+ {
207
+ path: "home",
208
+ type: 'screen',
209
+ component: HomeScreen,
210
+ options: {
211
+ tabBarLabel: "Home",
212
+ tabBarIcon: ({ focused, color }) => (
213
+ <Icon name="home" color={color} />
214
+ ),
215
+ tabBarBadge: 5
216
+ }
217
+ }
218
+ \`\`\`
219
+
220
+ ## Navigator Options
221
+
222
+ Options for navigator routes:
223
+
224
+ \`\`\`tsx
225
+ type NavigatorOptions = {
226
+ headerTitle?: React.ComponentType | React.ReactElement | string;
227
+ headerLeft?: React.ComponentType | React.ReactElement;
228
+ headerBackVisible?: boolean;
229
+ headerRight?: React.ComponentType | React.ReactElement;
230
+ headerShown?: boolean;
231
+ };
232
+ \`\`\`
233
+
234
+ Example:
235
+ \`\`\`tsx
236
+ {
237
+ path: "/app",
238
+ type: 'navigator',
239
+ layout: 'stack',
240
+ routes: [...],
241
+ options: {
242
+ headerTitle: "My App",
243
+ headerShown: true,
244
+ headerRight: <UserMenu />
245
+ }
246
+ }
247
+ \`\`\`
248
+
249
+ ## Nested Routes
250
+
251
+ Create hierarchical navigation:
252
+
253
+ \`\`\`tsx
254
+ const appRouter: RouteParam = {
255
+ path: "/",
256
+ type: 'navigator',
257
+ layout: 'stack',
258
+ routes: [
259
+ {
260
+ path: "dashboard",
261
+ type: 'navigator',
262
+ layout: 'tab',
263
+ routes: [
264
+ { path: "overview", type: 'screen', component: OverviewScreen },
265
+ { path: "analytics", type: 'screen', component: AnalyticsScreen },
266
+ { path: "reports", type: 'screen', component: ReportsScreen },
267
+ ]
268
+ },
269
+ {
270
+ path: "settings",
271
+ type: 'screen',
272
+ component: SettingsScreen
273
+ },
274
+ ]
275
+ };
276
+ \`\`\`
277
+
278
+ ## Full Path Resolution
279
+
280
+ Full paths are automatically computed:
281
+ - \`/dashboard/overview\`
282
+ - \`/dashboard/analytics\`
283
+ - \`/dashboard/reports\`
284
+ - \`/settings\`
285
+
286
+ ## Best Practices
287
+
288
+ 1. **Use relative paths** for child routes
289
+ 2. **Keep nesting shallow** (3 levels max recommended)
290
+ 3. **Group related screens** in navigators
291
+ 4. **Use meaningful paths** that reflect content
292
+ 5. **Define index routes** with empty path
293
+ 6. **Set appropriate options** for each screen type
294
+ `,
295
+
296
+ "idealyst://navigation/navigator-types": `# Navigator Types
297
+
298
+ Idealyst supports four navigator types: stack, tab, drawer, and modal. Each provides different navigation patterns.
299
+
300
+ ## Stack Navigator
301
+
302
+ Linear, hierarchical navigation - the most common pattern.
303
+
304
+ ### Configuration
305
+
306
+ \`\`\`tsx
307
+ {
308
+ path: "/app",
309
+ type: 'navigator',
310
+ layout: 'stack',
311
+ routes: [
312
+ { path: "", type: 'screen', component: HomeScreen },
313
+ { path: "profile", type: 'screen', component: ProfileScreen },
314
+ { path: "settings", type: 'screen', component: SettingsScreen },
315
+ ]
316
+ }
317
+ \`\`\`
318
+
319
+ ### Platform Behavior
320
+
321
+ **Mobile:**
322
+ - Native stack navigation with slide animations
323
+ - Hardware back button support
324
+ - Swipe-to-go-back gesture
325
+
326
+ **Web:**
327
+ - Browser history integration
328
+ - URL updates on navigation
329
+ - Back/forward browser buttons work
330
+
331
+ ### Use Cases
332
+ - Main app navigation
333
+ - Detail views
334
+ - Settings flows
335
+ - Onboarding sequences
336
+
337
+ ## Tab Navigator
338
+
339
+ Section-based navigation with a tab bar.
340
+
341
+ ### Configuration
342
+
343
+ \`\`\`tsx
344
+ {
345
+ path: "/",
346
+ type: 'navigator',
347
+ layout: 'tab',
348
+ routes: [
349
+ {
350
+ path: "home",
351
+ type: 'screen',
352
+ component: HomeScreen,
353
+ options: {
354
+ tabBarLabel: "Home",
355
+ tabBarIcon: ({ color }) => <Icon name="home" color={color} />
356
+ }
357
+ },
358
+ {
359
+ path: "search",
360
+ type: 'screen',
361
+ component: SearchScreen,
362
+ options: {
363
+ tabBarLabel: "Search",
364
+ tabBarIcon: ({ color }) => <Icon name="search" color={color} />
365
+ }
366
+ },
367
+ ]
368
+ }
369
+ \`\`\`
370
+
371
+ ### Platform Behavior
372
+
373
+ **Mobile:**
374
+ - Bottom tab bar
375
+ - Tab icons and labels
376
+ - Badge support
377
+ - Active tab highlighting
378
+
379
+ **Web:**
380
+ - Top or side tabs
381
+ - Can use custom layout component
382
+ - URL-based tab switching
383
+
384
+ ### Use Cases
385
+ - Main app sections
386
+ - Content categories
387
+ - Dashboard views
388
+ - Multi-section interfaces
389
+
390
+ ## Drawer Navigator
391
+
392
+ Side menu navigation, primarily for desktop/tablet.
393
+
394
+ ### Configuration
395
+
396
+ \`\`\`tsx
397
+ {
398
+ path: "/",
399
+ type: 'navigator',
400
+ layout: 'drawer',
401
+ routes: [
402
+ { path: "dashboard", type: 'screen', component: DashboardScreen },
403
+ { path: "users", type: 'screen', component: UsersScreen },
404
+ { path: "settings", type: 'screen', component: SettingsScreen },
405
+ ]
406
+ }
407
+ \`\`\`
408
+
409
+ ### Platform Behavior
410
+
411
+ **Mobile:**
412
+ - Slide-out drawer
413
+ - Swipe gesture to open
414
+ - Overlay when open
415
+
416
+ **Web:**
417
+ - Sidebar navigation
418
+ - Can be persistent or overlay
419
+ - Responsive behavior
420
+
421
+ ### Use Cases
422
+ - Admin panels
423
+ - Desktop applications
424
+ - Content management systems
425
+ - Multi-section apps
426
+
427
+ ## Modal Navigator
428
+
429
+ Overlay navigation for temporary screens.
430
+
431
+ ### Configuration
432
+
433
+ \`\`\`tsx
434
+ {
435
+ path: "/modals",
436
+ type: 'navigator',
437
+ layout: 'modal',
438
+ routes: [
439
+ { path: "new-post", type: 'screen', component: NewPostScreen },
440
+ { path: "edit-profile", type: 'screen', component: EditProfileScreen },
441
+ ]
442
+ }
443
+ \`\`\`
444
+
445
+ ### Platform Behavior
446
+
447
+ **Mobile:**
448
+ - Full-screen modal presentation
449
+ - Slide-up animation
450
+ - Close gesture support
451
+
452
+ **Web:**
453
+ - Overlay modal
454
+ - Background dimming
455
+ - Click-outside to close
456
+
457
+ ### Use Cases
458
+ - Forms and data entry
459
+ - Action confirmations
460
+ - Image viewers
461
+ - Temporary content
462
+
463
+ ## Combining Navigator Types
464
+
465
+ Navigators can be nested for complex flows:
466
+
467
+ \`\`\`tsx
468
+ const appRouter: RouteParam = {
469
+ path: "/",
470
+ type: 'navigator',
471
+ layout: 'stack',
472
+ routes: [
473
+ {
474
+ path: "main",
475
+ type: 'navigator',
476
+ layout: 'tab',
477
+ routes: [
478
+ { path: "feed", type: 'screen', component: FeedScreen },
479
+ { path: "profile", type: 'screen', component: ProfileScreen },
480
+ ]
481
+ },
482
+ {
483
+ path: "modals",
484
+ type: 'navigator',
485
+ layout: 'modal',
486
+ routes: [
487
+ { path: "create", type: 'screen', component: CreateScreen },
488
+ ]
489
+ }
490
+ ]
491
+ };
492
+ \`\`\`
493
+
494
+ ## Choosing the Right Navigator
495
+
496
+ | Navigator | Mobile | Desktop | Use Case |
497
+ |-----------|--------|---------|----------|
498
+ | **Stack** | ✅ Primary | ✅ Primary | Hierarchical navigation |
499
+ | **Tab** | ✅ Primary | ✅ Secondary | Section-based navigation |
500
+ | **Drawer** | ⚠️ Secondary | ✅ Primary | Menu-based navigation |
501
+ | **Modal** | ✅ Common | ✅ Common | Temporary overlays |
502
+
503
+ ## Best Practices
504
+
505
+ 1. **Use stack for most flows** - It's the most universal pattern
506
+ 2. **Limit tab count** - 3-5 tabs maximum for mobile
507
+ 3. **Reserve drawers for complex apps** - Best on desktop
508
+ 4. **Use modals sparingly** - For focused, temporary tasks
509
+ 5. **Consider platform** - What works on mobile may not work on web
510
+ 6. **Test navigation flow** - Ensure intuitive user experience
511
+ `,
512
+
513
+ "idealyst://navigation/custom-layouts": `# Custom Layouts (Web Only)
514
+
515
+ On web, navigators can use custom layout components to add headers, sidebars, and other UI around route content.
516
+
517
+ ## GeneralLayout Component
518
+
519
+ The built-in \`GeneralLayout\` provides header and sidebar functionality:
520
+
521
+ ### Basic Usage
522
+
523
+ \`\`\`tsx
524
+ import { GeneralLayout } from '@idealyst/navigation';
525
+
526
+ <GeneralLayout
527
+ header={{
528
+ enabled: true,
529
+ content: <Text>My App</Text>,
530
+ }}
531
+ sidebar={{
532
+ enabled: true,
533
+ content: <NavigationMenu />,
534
+ }}
535
+ >
536
+ {children}
537
+ </GeneralLayout>
538
+ \`\`\`
539
+
540
+ ### Header Configuration
541
+
542
+ \`\`\`tsx
543
+ type HeaderConfig = {
544
+ enabled: boolean; // Show/hide header
545
+ height?: number; // Header height (default: 64)
546
+ content?: React.ReactNode; // Header content
547
+ style?: ViewStyle; // Custom styles
548
+ };
549
+ \`\`\`
550
+
551
+ Example:
552
+ \`\`\`tsx
553
+ header={{
554
+ enabled: true,
555
+ height: 80,
556
+ content: (
557
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 16 }}>
558
+ <Text size="lg" weight="bold">Dashboard</Text>
559
+ <UserMenu />
560
+ </View>
561
+ )
562
+ }}
563
+ \`\`\`
564
+
565
+ ### Sidebar Configuration
566
+
567
+ \`\`\`tsx
568
+ type SidebarConfig = {
569
+ enabled: boolean; // Show/hide sidebar
570
+ collapsible?: boolean; // Allow collapse/expand
571
+ position?: 'left' | 'right'; // Sidebar position
572
+ initiallyExpanded?: boolean; // Initial state
573
+ expandedWidth?: number; // Width when expanded (default: 240)
574
+ collapsedWidth?: number; // Width when collapsed (default: 64)
575
+ content?: React.ReactNode; // Sidebar content
576
+ style?: ViewStyle; // Custom styles
577
+ };
578
+ \`\`\`
579
+
580
+ Example:
581
+ \`\`\`tsx
582
+ sidebar={{
583
+ enabled: true,
584
+ collapsible: true,
585
+ position: 'left',
586
+ initiallyExpanded: true,
587
+ expandedWidth: 280,
588
+ collapsedWidth: 72,
589
+ content: <NavigationSidebar />
590
+ }}
591
+ \`\`\`
592
+
593
+ ## Using Layouts with Navigators
594
+
595
+ ### Stack Navigator with Layout
596
+
597
+ \`\`\`tsx
598
+ import { CustomStackLayout } from './layouts/CustomStackLayout';
599
+
600
+ const router: NavigatorParam = {
601
+ path: "/",
602
+ type: 'navigator',
603
+ layout: 'stack',
604
+ layoutComponent: CustomStackLayout, // Web only!
605
+ routes: [
606
+ { path: "", type: 'screen', component: HomeScreen },
607
+ { path: "about", type: 'screen', component: AboutScreen },
608
+ ]
609
+ };
610
+ \`\`\`
611
+
612
+ ### Tab Navigator with Layout
613
+
614
+ \`\`\`tsx
615
+ import { CustomTabLayout } from './layouts/CustomTabLayout';
616
+
617
+ const router: NavigatorParam = {
618
+ path: "/",
619
+ type: 'navigator',
620
+ layout: 'tab',
621
+ layoutComponent: CustomTabLayout, // Web only!
622
+ routes: [
623
+ { path: "feed", type: 'screen', component: FeedScreen },
624
+ { path: "profile", type: 'screen', component: ProfileScreen },
625
+ ]
626
+ };
627
+ \`\`\`
628
+
629
+ ## Creating Custom Layouts
630
+
631
+ ### Stack Layout Component
632
+
633
+ \`\`\`tsx
634
+ import { GeneralLayout } from '@idealyst/navigation';
635
+ import type { StackLayoutProps } from '@idealyst/navigation';
636
+
637
+ export const CustomStackLayout: React.FC<StackLayoutProps> = ({
638
+ children,
639
+ options,
640
+ routes,
641
+ currentPath
642
+ }) => {
643
+ return (
644
+ <GeneralLayout
645
+ header={{
646
+ enabled: true,
647
+ content: (
648
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
649
+ <Text>{options?.headerTitle || 'My App'}</Text>
650
+ {options?.headerRight}
651
+ </View>
652
+ )
653
+ }}
654
+ sidebar={{
655
+ enabled: true,
656
+ collapsible: true,
657
+ content: (
658
+ <NavigationMenu routes={routes} currentPath={currentPath} />
659
+ )
660
+ }}
661
+ >
662
+ {children}
663
+ </GeneralLayout>
664
+ );
665
+ };
666
+ \`\`\`
667
+
668
+ ### Tab Layout Component
669
+
670
+ \`\`\`tsx
671
+ import type { TabLayoutProps } from '@idealyst/navigation';
672
+
673
+ export const CustomTabLayout: React.FC<TabLayoutProps> = ({
674
+ children,
675
+ routes,
676
+ currentPath
677
+ }) => {
678
+ const navigator = useNavigator();
679
+
680
+ return (
681
+ <View style={{ flex: 1 }}>
682
+ {/* Custom tab bar */}
683
+ <View style={{ flexDirection: 'row', borderBottom: '1px solid #ccc' }}>
684
+ {routes.map(route => (
685
+ <Pressable
686
+ key={route.path}
687
+ onPress={() => navigator.navigate({ path: route.fullPath, vars: {} })}
688
+ style={{
689
+ padding: 16,
690
+ borderBottom: currentPath === route.fullPath ? '2px solid blue' : 'none'
691
+ }}
692
+ >
693
+ <Text>{route.options?.tabBarLabel || route.path}</Text>
694
+ </Pressable>
695
+ ))}
696
+ </View>
697
+
698
+ {/* Content */}
699
+ <View style={{ flex: 1 }}>
700
+ {children}
701
+ </View>
702
+ </View>
703
+ );
704
+ };
705
+ \`\`\`
706
+
707
+ ## Layout Props Reference
708
+
709
+ ### StackLayoutProps
710
+
711
+ \`\`\`tsx
712
+ type StackLayoutProps = {
713
+ options?: NavigatorOptions; // Navigator options
714
+ routes: RouteWithFullPath[]; // All routes with full paths
715
+ currentPath: string; // Current active path
716
+ children?: React.ReactNode; // Route content
717
+ };
718
+ \`\`\`
719
+
720
+ ### TabLayoutProps
721
+
722
+ \`\`\`tsx
723
+ type TabLayoutProps = {
724
+ options?: NavigatorOptions; // Navigator options
725
+ routes: RouteWithFullPath<TabBarScreenOptions>[]; // Tab routes
726
+ currentPath: string; // Current active path
727
+ children?: React.ReactNode; // Route content
728
+ };
729
+ \`\`\`
730
+
731
+ ## Real-World Examples
732
+
733
+ ### Dashboard Layout
734
+
735
+ \`\`\`tsx
736
+ export const DashboardLayout: React.FC<StackLayoutProps> = ({
737
+ children,
738
+ routes,
739
+ currentPath
740
+ }) => {
741
+ return (
742
+ <GeneralLayout
743
+ header={{
744
+ enabled: true,
745
+ height: 72,
746
+ content: (
747
+ <View style={{
748
+ flexDirection: 'row',
749
+ justifyContent: 'space-between',
750
+ alignItems: 'center',
751
+ padding: 16
752
+ }}>
753
+ <Text size="xl" weight="bold">Dashboard</Text>
754
+ <View style={{ flexDirection: 'row', gap: 16 }}>
755
+ <NotificationBell />
756
+ <UserAvatar />
757
+ </View>
758
+ </View>
759
+ )
760
+ }}
761
+ sidebar={{
762
+ enabled: true,
763
+ collapsible: true,
764
+ position: 'left',
765
+ expandedWidth: 260,
766
+ content: <DashboardSidebar routes={routes} currentPath={currentPath} />
767
+ }}
768
+ >
769
+ {children}
770
+ </GeneralLayout>
771
+ );
772
+ };
773
+ \`\`\`
774
+
775
+ ### Admin Panel Layout
776
+
777
+ \`\`\`tsx
778
+ export const AdminLayout: React.FC<StackLayoutProps> = ({ children }) => {
779
+ return (
780
+ <GeneralLayout
781
+ header={{
782
+ enabled: true,
783
+ content: <AdminHeader />,
784
+ style: { backgroundColor: '#1a1a1a', color: '#fff' }
785
+ }}
786
+ sidebar={{
787
+ enabled: true,
788
+ collapsible: true,
789
+ position: 'left',
790
+ initiallyExpanded: true,
791
+ content: <AdminNavigationMenu />,
792
+ style: { backgroundColor: '#2a2a2a' }
793
+ }}
794
+ >
795
+ <View style={{ padding: 24 }}>
796
+ {children}
797
+ </View>
798
+ </GeneralLayout>
799
+ );
800
+ };
801
+ \`\`\`
802
+
803
+ ## Best Practices
804
+
805
+ 1. **Use GeneralLayout as base** - Don't reinvent header/sidebar logic
806
+ 2. **Keep layouts simple** - Complex logic belongs in screens
807
+ 3. **Make responsive** - Consider different screen sizes
808
+ 4. **Theme-aware** - Use theme colors and spacing
809
+ 5. **Accessible** - Ensure keyboard and screen reader support
810
+ 6. **Performance** - Memoize layout components when possible
811
+ 7. **Consistent** - Use same layout for similar sections
812
+
813
+ ## Platform Considerations
814
+
815
+ - **Web only**: Layout components only apply to web
816
+ - **Mobile**: Uses native navigation components
817
+ - **Conditional rendering**: Check platform if needed
818
+ - **Testing**: Test both platforms separately
819
+ `,
820
+
821
+ "idealyst://navigation/use-navigator": `# useNavigator Hook
822
+
823
+ The \`useNavigator\` hook provides navigation functionality and route information within your components.
824
+
825
+ ## Basic Usage
826
+
827
+ \`\`\`tsx
828
+ import { useNavigator } from '@idealyst/navigation';
829
+
830
+ function MyComponent() {
831
+ const navigator = useNavigator();
832
+
833
+ return (
834
+ <Button onPress={() => navigator.navigate({ path: '/profile', vars: {} })}>
835
+ Go to Profile
836
+ </Button>
837
+ );
838
+ }
839
+ \`\`\`
840
+
841
+ ## API Reference
842
+
843
+ ### navigator.navigate()
844
+
845
+ Navigate to a route:
846
+
847
+ \`\`\`tsx
848
+ navigator.navigate({
849
+ path: string;
850
+ vars: Record<string, string>;
851
+ });
852
+ \`\`\`
853
+
854
+ Examples:
855
+ \`\`\`tsx
856
+ // Simple navigation
857
+ navigator.navigate({ path: '/home', vars: {} });
858
+
859
+ // With path parameters
860
+ navigator.navigate({
861
+ path: '/user/:id',
862
+ vars: { id: '123' }
863
+ });
864
+
865
+ // With query parameters
866
+ navigator.navigate({
867
+ path: '/search',
868
+ vars: { q: 'react', category: 'tutorial' }
869
+ });
870
+ \`\`\`
871
+
872
+ ### navigator.vars
873
+
874
+ Access current route variables:
875
+
876
+ \`\`\`tsx
877
+ const navigator = useNavigator();
878
+ const userId = navigator.vars.id; // Path param
879
+ const searchQuery = navigator.vars.q; // Query param
880
+ \`\`\`
881
+
882
+ ### navigator.currentPath
883
+
884
+ Get the current route path:
885
+
886
+ \`\`\`tsx
887
+ const navigator = useNavigator();
888
+ const path = navigator.currentPath;
889
+
890
+ console.log(path); // "/user/123"
891
+ \`\`\`
892
+
893
+ ### navigator.goBack()
894
+
895
+ Navigate to previous screen (mobile only):
896
+
897
+ \`\`\`tsx
898
+ <Button onPress={() => navigator.goBack()}>
899
+ Go Back
900
+ </Button>
901
+ \`\`\`
902
+
903
+ **Note**: On web, use browser back button or navigator.navigate() to specific routes.
904
+
905
+ ## Path Parameters
906
+
907
+ ### Defining Parameters
908
+
909
+ In route configuration:
910
+ \`\`\`tsx
911
+ {
912
+ path: "user/:id",
913
+ type: 'screen',
914
+ component: UserScreen
915
+ }
916
+ \`\`\`
917
+
918
+ ### Accessing Parameters
919
+
920
+ In the screen component:
921
+ \`\`\`tsx
922
+ function UserScreen() {
923
+ const navigator = useNavigator();
924
+ const userId = navigator.vars.id;
925
+
926
+ return <Text>User ID: {userId}</Text>;
927
+ }
928
+ \`\`\`
929
+
930
+ ### Multiple Parameters
931
+
932
+ \`\`\`tsx
933
+ // Route: "post/:postId/comment/:commentId"
934
+
935
+ // Navigate:
936
+ navigator.navigate({
937
+ path: '/post/:postId/comment/:commentId',
938
+ vars: { postId: '42', commentId: '7' }
939
+ });
940
+
941
+ // Access:
942
+ const postId = navigator.vars.postId;
943
+ const commentId = navigator.vars.commentId;
944
+ \`\`\`
945
+
946
+ ## Query Parameters
947
+
948
+ ### Passing Query Params
949
+
950
+ \`\`\`tsx
951
+ navigator.navigate({
952
+ path: '/search',
953
+ vars: {
954
+ q: 'typescript',
955
+ category: 'tutorial',
956
+ sort: 'recent'
957
+ }
958
+ });
959
+
960
+ // Results in: /search?q=typescript&category=tutorial&sort=recent
961
+ \`\`\`
962
+
963
+ ### Reading Query Params
964
+
965
+ \`\`\`tsx
966
+ function SearchScreen() {
967
+ const navigator = useNavigator();
968
+
969
+ const query = navigator.vars.q;
970
+ const category = navigator.vars.category;
971
+ const sort = navigator.vars.sort;
972
+
973
+ // Use params...
974
+ }
975
+ \`\`\`
976
+
977
+ ## Navigation Patterns
978
+
979
+ ### Programmatic Navigation
980
+
981
+ Navigate based on conditions:
982
+
983
+ \`\`\`tsx
984
+ function LoginScreen() {
985
+ const navigator = useNavigator();
986
+
987
+ const handleLogin = async () => {
988
+ const success = await login(credentials);
989
+
990
+ if (success) {
991
+ navigator.navigate({ path: '/dashboard', vars: {} });
992
+ }
993
+ };
994
+
995
+ return <Button onPress={handleLogin}>Login</Button>;
996
+ }
997
+ \`\`\`
998
+
999
+ ### Navigation with Data
1000
+
1001
+ Pass data through navigation:
1002
+
1003
+ \`\`\`tsx
1004
+ // List screen
1005
+ <Button onPress={() => {
1006
+ navigator.navigate({
1007
+ path: '/product/:id',
1008
+ vars: { id: product.id }
1009
+ });
1010
+ }}>
1011
+ View Product
1012
+ </Button>
1013
+
1014
+ // Detail screen
1015
+ function ProductScreen() {
1016
+ const navigator = useNavigator();
1017
+ const productId = navigator.vars.id;
1018
+
1019
+ const product = useProduct(productId);
1020
+ // Render product...
1021
+ }
1022
+ \`\`\`
1023
+
1024
+ ### Conditional Navigation
1025
+
1026
+ Navigate based on user state:
1027
+
1028
+ \`\`\`tsx
1029
+ function ProtectedScreen() {
1030
+ const navigator = useNavigator();
1031
+ const { user } = useAuth();
1032
+
1033
+ useEffect(() => {
1034
+ if (!user) {
1035
+ navigator.navigate({ path: '/login', vars: {} });
1036
+ }
1037
+ }, [user]);
1038
+
1039
+ return user ? <Content /> : null;
1040
+ }
1041
+ \`\`\`
1042
+
1043
+ ## Advanced Usage
1044
+
1045
+ ### Navigation Guards
1046
+
1047
+ \`\`\`tsx
1048
+ function useAuthGuard() {
1049
+ const navigator = useNavigator();
1050
+ const { isAuthenticated } = useAuth();
1051
+
1052
+ useEffect(() => {
1053
+ if (!isAuthenticated && navigator.currentPath !== '/login') {
1054
+ navigator.navigate({ path: '/login', vars: {} });
1055
+ }
1056
+ }, [isAuthenticated, navigator.currentPath]);
1057
+ }
1058
+
1059
+ function App() {
1060
+ useAuthGuard();
1061
+ return <AppContent />;
1062
+ }
1063
+ \`\`\`
1064
+
1065
+ ### Deep Linking
1066
+
1067
+ Handle deep links:
1068
+
1069
+ \`\`\`tsx
1070
+ useEffect(() => {
1071
+ const handleDeepLink = (url: string) => {
1072
+ // Parse URL and navigate
1073
+ const path = parseDeepLink(url);
1074
+ navigator.navigate({ path, vars: {} });
1075
+ };
1076
+
1077
+ // Add deep link listener
1078
+ const subscription = Linking.addEventListener('url', ({ url }) => {
1079
+ handleDeepLink(url);
1080
+ });
1081
+
1082
+ return () => subscription.remove();
1083
+ }, []);
1084
+ \`\`\`
1085
+
1086
+ ### Navigation History
1087
+
1088
+ Track navigation history:
1089
+
1090
+ \`\`\`tsx
1091
+ function useNavigationHistory() {
1092
+ const navigator = useNavigator();
1093
+ const [history, setHistory] = useState<string[]>([]);
1094
+
1095
+ useEffect(() => {
1096
+ setHistory(prev => [...prev, navigator.currentPath]);
1097
+ }, [navigator.currentPath]);
1098
+
1099
+ return history;
1100
+ }
1101
+ \`\`\`
1102
+
1103
+ ## TypeScript Support
1104
+
1105
+ Type-safe navigation:
1106
+
1107
+ \`\`\`tsx
1108
+ type NavigateParams = {
1109
+ path: string;
1110
+ vars: Record<string, string>;
1111
+ };
1112
+
1113
+ // Strongly typed vars
1114
+ type UserRouteVars = {
1115
+ id: string;
1116
+ tab?: 'posts' | 'comments' | 'likes';
1117
+ };
1118
+
1119
+ // Usage
1120
+ navigator.navigate({
1121
+ path: '/user/:id',
1122
+ vars: { id: '123', tab: 'posts' } as UserRouteVars
1123
+ });
1124
+ \`\`\`
1125
+
1126
+ ## Platform Differences
1127
+
1128
+ ### React Native
1129
+ - \`goBack()\` uses native navigation stack
1130
+ - Hardware back button supported
1131
+ - Gesture-based navigation
1132
+
1133
+ ### Web
1134
+ - Browser back/forward buttons work
1135
+ - URL updates automatically
1136
+ - Bookmarkable URLs
1137
+ - \`goBack()\` uses browser history
1138
+
1139
+ ## Best Practices
1140
+
1141
+ 1. **Always provide vars** - Even if empty: \`{}\`
1142
+ 2. **Type your routes** - Use TypeScript for safety
1143
+ 3. **Handle errors** - Check if navigation succeeded
1144
+ 4. **Avoid navigation in render** - Use effects or handlers
1145
+ 5. **Clean up listeners** - Remove event listeners on unmount
1146
+ 6. **Test navigation flow** - Verify all paths work
1147
+ 7. **Use path params for IDs** - Not query params
1148
+ 8. **Use query params for filters** - Not path params
1149
+
1150
+ ## Common Patterns
1151
+
1152
+ ### Back Navigation
1153
+
1154
+ \`\`\`tsx
1155
+ <Button
1156
+ icon="arrow-left"
1157
+ onPress={() => navigator.goBack()}
1158
+ >
1159
+ Back
1160
+ </Button>
1161
+ \`\`\`
1162
+
1163
+ ### Tab Navigation
1164
+
1165
+ \`\`\`tsx
1166
+ const tabs = ['feed', 'search', 'profile'];
1167
+
1168
+ <View>
1169
+ {tabs.map(tab => (
1170
+ <Button
1171
+ key={tab}
1172
+ onPress={() => navigator.navigate({ path: \`/\${tab}\`, vars: {} })}
1173
+ variant={navigator.currentPath === \`/\${tab}\` ? 'contained' : 'outlined'}
1174
+ >
1175
+ {tab}
1176
+ </Button>
1177
+ ))}
1178
+ </View>
1179
+ \`\`\`
1180
+
1181
+ ### Modal Navigation
1182
+
1183
+ \`\`\`tsx
1184
+ <Button onPress={() => {
1185
+ navigator.navigate({
1186
+ path: '/modal/create-post',
1187
+ vars: {}
1188
+ });
1189
+ }}>
1190
+ Create Post
1191
+ </Button>
1192
+
1193
+ // In modal:
1194
+ <Button onPress={() => navigator.goBack()}>
1195
+ Close
1196
+ </Button>
1197
+ \`\`\`
1198
+ `,
1199
+ };