Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@react-native-menu/menu
Advanced tools
iOS14+ UIMenu component for react-native. Falls back to ActionSheet for versions below iOS14.
iOS 14+ | iOS 13 |
---|---|
via npm:
npm install @react-native-menu/menu
via yarn:
yarn add @react-native-menu/menu
The package is automatically linked when building the app. All you need to do is:
npx pod-install
import { MenuView } from '@react-native-menu/menu';
// ...
const App = () => {
return (
<View style={styles.container}>
<MenuView
title="Menu Title"
onPressAction={({ nativeEvent }) => {
console.warn(JSON.stringify(nativeEvent));
}}
actions={[
{
id: 'add',
title: 'Add to List',
image: 'plus',
},
{
id: 'share',
title: 'Share Action',
subtitle: 'Share action on SNS',
image: 'square.and.arrow.up',
state: 'on',
},
{
id: 'destructive',
title: 'Destructive Action',
attributes: {
destructive: true,
},
image: 'trash',
},
]}
>
<View style={styles.button}>
<Text style={styles.buttonText}>Test</Text>
</View>
</MenuView>
</View>
);
};
title
The title of the menu.
Type | Required |
---|---|
string | No |
actions
Actions to be displayed in the menu.
Type | Required |
---|---|
MenuAction[] | Yes |
MenuAction
Object representing Menu Action.
export type MenuAction = {
/**
* Identifier of the menu action.
* The value set in this id will be returned when menu is selected.
*/
id?: string;
/**
* The action's title.
*/
title: string;
/**
* (iOS14+ only)
* An elaborated title that explains the purpose of the action.
*/
subtitle?: string;
/**
* The attributes indicating the style of the action.
*/
attributes?: MenuAttributes;
/**
* (iOS14+ only)
* The state of the action.
*/
state?: MenuState;
/**
* (iOS13+ only)
* - The action's image.
* - Allows icon name included in SF Symbol
* - TODO: Allow images other than those included in SF Symbol
*/
image?: string;
};
MenuAttributes
The attributes indicating the style of the action.
type MenuAttributes = {
/**
* An attribute indicating the destructive style.
*/
destructive?: boolean;
/**
* An attribute indicating the disabled style.
*/
disabled?: boolean;
/**
* An attribute indicating the hidden style.
*/
hidden?: boolean;
};
MenuState
The state of the action.
/**
* The state of the action.
* - off: A constant indicating the menu element is in the “off” state.
* - on: A constant indicating the menu element is in the “on” state.
* - mixed: A constant indicating the menu element is in the “mixed” state.
*/
type MenuState = 'off' | 'on' | 'mixed';
onPressAction
Callback function that will be called when selecting a menu item. It will contain id of the given action.
Type | Required |
---|---|
({nativeEvent}) => void | No |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
UIMenu component for react-native
The npm package @react-native-menu/menu receives a total of 19,279 weekly downloads. As such, @react-native-menu/menu popularity was classified as popular.
We found that @react-native-menu/menu demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.