Skip to content

Conversation

@patrickkabwe
Copy link
Owner

closes #55

Description

Add menus prop to NitroText so apps can surface custom actions in the iOS selection menu.

Usage

import React, { useMemo } from 'react'
import { NitroText as Text } from 'react-native-nitro-text'

export function ArticleBody() {
  const menus = useMemo(
    () => [
      { title: 'Ask ChatGPT', action: () => console.log('Ask ChatGPT') },
      { title: 'Translate', action: () => console.log('Translate') },
    ],
    []
  )

  return (
    <Text selectable menus={menus} style={{ fontSize: 16, lineHeight: 22 }}>
      Select part of this paragraph to see the custom actions in the edit menu.
    </Text>
  )
}

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other

Testing

  • Tested on iOS
  • Tested on Android
  • Added/updated tests

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)

Additional Notes

Any additional information for reviewers.

@patrickkabwe patrickkabwe merged commit f88aee7 into main Oct 28, 2025
4 checks passed
@patrickkabwe patrickkabwe deleted the feat/nitro-text-selection-menus branch October 28, 2025 12:26
github-actions bot pushed a commit that referenced this pull request Nov 15, 2025
## [1.1.0](v1.0.3...v1.1.0) (2025-11-15)

### ✨ Features

* **ios:** support custom selection menus ([#92](#92)) ([f88aee7](f88aee7))

### 🐛 Bug Fixes

* **ios:** dismiss selection when tapping outside textview ([#70](#70)) ([f6eddb2](f6eddb2))

### 📚 Documentation

* add CONTRIBUTING.md and issue templates for better community engagement ([#48](#48)) ([a213abe](a213abe))

### 🛠️ Other changes

* code linting formating ([#101](#101)) ([e49a5d3](e49a5d3))
* prepare android support ([#102](#102)) ([7a2c2bd](7a2c2bd))
@github-actions
Copy link

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Custom context menu of selection

2 participants