https://github.com/rintoj/native-x-context-menu
Context menu component
https://github.com/rintoj/native-x-context-menu
Last synced: 1 day ago
JSON representation
Context menu component
- Host: GitHub
- URL: https://github.com/rintoj/native-x-context-menu
- Owner: rintoj
- Created: 2021-06-29T15:20:50.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-17T09:20:29.000Z (almost 5 years ago)
- Last Synced: 2026-01-02T22:41:33.623Z (6 months ago)
- Language: TypeScript
- Size: 155 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# native-x-context-menu
[](https://github.com/semantic-release/semantic-release)
Component that providers context menu capabilities
## Install
### Yarn
```sh
yarn add native-x-context-menu
```
### NPM
```sh
npm install native-x-context-menu
```
## Usage
```tsx
import {
ContextMenu,
ContextMenuItem,
ContextMenuProvider,
ContextMenuSeparator,
} from 'native-x-context-menu'
import { CheckmarkIcon, CloseIcon, CopyOutlineIcon, TrashOutlineIcon } from 'native-x-icon'
function MyComponent() {
return (
...
Approve
Alert.alert('Reject')}>
Reject
Copy Link
Delete
)
}
```
## API ContextMenu
| Property | Default Value | Usage |
| ------------------------- | --------------- | -------------------------------------- |
| backgroundColor?: string | COLOR.PRIMARY | Container color |
| textColor?: string | COLOR.SECONDARY | Default color for ContextMenuItem |
| iconColor?: string | COLOR.TERTIARY | Default icon color for ContextMenuItem |
| children?: ReactElement[] | | List of ContextMenuItem |
## API ContextMenuItem
| Property | Default Value | Usage |
| ------------------------ | --------------- | --------------------------------------------------------------------- |
| children: string | | Menu text |
| icon?: ReactElement | | Icon. Eg: icon={} |
| disabled?: boolean | | Disabled if true |
| backgroundColor?: string | COLOR.PRIMARY | Background color |
| textColor?: string | COLOR.SECONDARY | Text color for ContextMenuItem - overrides textColor from ContextMenu |
| iconColor?: string | COLOR.TERTIARY | Text color for ContextMenuItem - overrides iconColor from ContextMenu |
| onPress?: () => void | | Callback handler for onPress |
## Automatic Release
Here is an example of the release type that will be done based on a commit messages:
| Commit message | Release type |
| ------------------- | --------------------- |
| fix: [comment] | Patch Release |
| feat: [comment] | Minor Feature Release |
| perf: [comment] | Major Feature Release |
| doc: [comment] | No Release |
| refactor: [comment] | No Release |
| chore: [comment] | No Release |