@@ -25,6 +25,7 @@ A native menu component for React Native that provides platform-specific context
2525- ✅ Custom trigger components - pass any React Native component as a child
2626- ✅ Customizable colors for menu items
2727- ✅ Checkmark support with custom colors
28+ - ✅ SF Symbols support on iOS (iosSymbol property)
2829- ✅ Scrollable menus for long lists
2930- ✅ Event handling for menu item selection
3031- ✅ TypeScript support
@@ -172,6 +173,64 @@ const [selectedSort, setSelectedSort] = useState('date');
172173</MenuView >
173174```
174175
176+ ### Disabled Menu
177+
178+ ``` tsx
179+ const [isDisabled, setIsDisabled] = useState (false );
180+
181+ <MenuView
182+ disabled = { isDisabled }
183+ menuItems = { [
184+ { identifier: ' enable' , title: ' Enable Menu' },
185+ { identifier: ' disable' , title: ' Disable Menu' },
186+ ]}
187+ onMenuSelect = { ({ nativeEvent }) => {
188+ setIsDisabled (nativeEvent .identifier === ' disable' );
189+ }}
190+ >
191+ <View style = { [styles .menuButton , isDisabled && styles .disabledButton ]} >
192+ <Text style = { [styles .menuButtonText , isDisabled && styles .disabledText ]} >
193+ { isDisabled ? ' 🔒 Menu Disabled' : ' 🔓 Menu Enabled' }
194+ </Text >
195+ </View >
196+ </MenuView >
197+
198+ // Add these styles
199+ const styles = StyleSheet .create ({
200+ // ... other styles
201+ disabledButton: {
202+ opacity: 0.6 ,
203+ },
204+ disabledText: {
205+ color: ' #999' ,
206+ },
207+ });
208+ ```
209+
210+ ### SF Symbols (iOS only)
211+
212+ ``` tsx
213+ import { MenuView } from ' react-native-menus' ;
214+
215+ <MenuView
216+ menuItems = { [
217+ { identifier: ' profile' , title: ' View Profile' , iosSymbol: ' person.circle' },
218+ { identifier: ' settings' , title: ' Settings' , iosSymbol: ' gear' },
219+ { identifier: ' logout' , title: ' Logout' , iosSymbol: ' arrow.right.square' },
220+ ]}
221+ onMenuSelect = { handleMenuSelect }
222+ >
223+ <View style = { styles .menuButton } >
224+ <Text >👤 Account Menu with SF Symbols</Text >
225+ </View >
226+ </MenuView >
227+ ```
228+
229+ For a list of available SF Symbols, refer to Apple's [ SF Symbols app] ( https://developer.apple.com/sf-symbols/ ) or use common names like:
230+ - ` "arrow.up" ` , ` "arrow.down" ` , ` "arrow.left" ` , ` "arrow.right" `
231+ - ` "gear" ` , ` "heart" ` , ` "trash" ` , ` "checkmark" ` , ` "xmark" `
232+ - Add ` .fill ` suffix for filled variants: ` "heart.fill" ` , ` "gear.fill" `
233+
175234## API Reference
176235
177236### Props
@@ -185,6 +244,7 @@ const [selectedSort, setSelectedSort] = useState('date');
185244| ` checkedColor ` | ` string ` | No | ` #007AFF ` | Color for checked/selected menu items (Android only) |
186245| ` uncheckedColor ` | ` string ` | No | ` #8E8E93 ` | Color for unchecked/unselected menu items (Android only) |
187246| ` color ` | ` string ` | No | - | Reserved for future use |
247+ | ` disabled ` | ` boolean ` | No | ` false ` | Disables the menu interaction when set to ` true ` |
188248| ` style ` | ` ViewStyle ` | No | - | Style applied to the container view |
189249
190250### Types
@@ -195,6 +255,7 @@ const [selectedSort, setSelectedSort] = useState('date');
195255interface MenuItem {
196256 identifier: string ; // Unique identifier for the menu item
197257 title: string ; // Display text for the menu item
258+ iosSymbol? : string ; // iOS-only: SF Symbol name to show beside the title (e.g., "gear", "heart.fill")
198259}
199260```
200261
@@ -254,6 +315,7 @@ The MenuView component accepts any React Native component as a child, which beco
254315| Feature | iOS | Android |
255316| ---------| -----| ---------|
256317| Menu Style | Native UIMenu popover | Modal dialog at bottom |
318+ | SF Symbols | ✅ Full support via ` iosSymbol ` property | ❌ Not supported |
257319| Checkmark Color | System default (not customizable) | Fully customizable |
258320| Unchecked Color | System default | Fully customizable |
259321| Animation | Native iOS animation | Slide up animation |
0 commit comments