An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# native-x-context-menu

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](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 |