Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ https://github.com/user-attachments/assets/57f56b3f-3988-4235-af83-a5f2cfd82121
- Works on both iOS and Android(currently fallback to RN `Text` on Android)
- Native iOS rendering with smooth selection.
- Nested fragments merge into a single native text view
- Rendering Markdown and HTML (coming soon).
- Supports only the New Architecture

## Requirements
Expand Down Expand Up @@ -84,26 +83,6 @@ export function SelectionExample() {
}
```

## HTML rendering

NitroText can parse HTML string children and inline CSS when you pass `renderer="html"`.

```tsx
import { NitroText } from 'react-native-nitro-text'

export function HtmlExample() {
const html = `
<div>
<h2>Renderer demo</h2>
<p>This text comes from <strong>HTML</strong> with <em>semantic</em> tags.</p>
<p><span style="color: #ff6347; font-weight: bold;">Inline CSS works too.</span></p>
</div>
`

return <NitroText renderer="html">{html}</NitroText>
}
```

## Custom selection menu

NitroText supports custom menu items that appear when text is selected. Pass a `menus` prop with an array of menu items, each containing a `title` and `action` callback.
Expand Down
11 changes: 0 additions & 11 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Text } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { PlainTextScreen } from './screens/PlainTextScreen';
import { HtmlScreen } from './screens/HtmlScreen';
import { PerformanceScreen } from './screens/PerformanceScreen';

const Tab = createBottomTabNavigator();
Expand All @@ -27,16 +26,6 @@ function MyTabs() {
),
}}
/>
<Tab.Screen
name="HTML"
component={HtmlScreen}
options={{
tabBarLabel: 'HTML',
tabBarIcon: ({ color, size }) => (
<Text style={{ fontSize: size }}>🌐</Text>
),
}}
/>
<Tab.Screen
name="Performance"
component={PerformanceScreen}
Expand Down
251 changes: 0 additions & 251 deletions example/src/screens/HtmlScreen.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions example/src/screens/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ export const styles = StyleSheet.create({
section: {
marginBottom: 32,
},
htmlSection: {
backgroundColor: 'white',
padding: 16,
borderRadius: 8,
borderWidth: 1,
borderColor: '#dee2e6',
marginTop: 8,
},

// Headers
mainTitle: {
fontSize: 25,
Expand Down Expand Up @@ -418,4 +409,3 @@ export const styles = StyleSheet.create({
lineHeight: 20,
},
});

6 changes: 0 additions & 6 deletions ios/HybridNitroText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ class HybridNitroText: HybridNitroTextSpec, NitroTextViewDelegate {
didSet { markNeedsApply() }
}

var renderer: Renderer? {
didSet {
markNeedsApply()
}
}

var selectable: Bool? {
didSet {
nitroTextImpl.setSelectable(selectable)
Expand Down
20 changes: 1 addition & 19 deletions nitrogen/generated/ios/NitroText-Swift-Cxx-Bridge.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading