Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
daea379
feat: text field component
wonderlul May 14, 2026
72ba9d5
chore: interface to type
wonderlul May 15, 2026
5446df6
feat: remove override props
wonderlul May 15, 2026
50fc4d9
chore: pointer events declared in styles
wonderlul May 15, 2026
32ed62f
chore: isweb to inline check
wonderlul May 15, 2026
77049d0
chore: remove unnecessary spyon in jest
wonderlul May 15, 2026
6a7f01e
chore: remove unnecessary comments
wonderlul May 15, 2026
492964a
feat: use locale instead of i18n manager
wonderlul May 15, 2026
d839884
feat: accessories as function not components
wonderlul May 15, 2026
dbb91ff
feat: introduce separate disable props
wonderlul May 15, 2026
b03311e
feat: render prop
wonderlul May 18, 2026
aa19edf
chore: text field icon props
wonderlul May 18, 2026
617becb
chore: ts style declarations
wonderlul May 18, 2026
996d92c
feat: a11y
wonderlul May 19, 2026
b83c03c
chore: dimensions round
wonderlul May 19, 2026
7adba7d
chore: style adjustment
wonderlul May 19, 2026
8322405
chore: refactor
wonderlul May 20, 2026
8effa88
feat: uncontrolled variant
wonderlul May 20, 2026
2dbd99d
chore: docs
wonderlul May 20, 2026
0f534fd
chore: refactor
wonderlul May 20, 2026
635c092
chore: uncontrolled variant state management
wonderlul May 25, 2026
0d114b2
chore: event-driven animations
wonderlul May 27, 2026
f5d6605
chore: implementation details
wonderlul May 27, 2026
3ecda7e
feat: text input migration
wonderlul May 27, 2026
c425f48
fix: docs building
wonderlul May 27, 2026
60bd209
chore: docs migration guide
wonderlul May 27, 2026
2c87935
chore: merge from main
wonderlul May 27, 2026
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
1 change: 1 addition & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: ['@docusaurus/core/lib/babel/preset'],
plugins: ['react-native-reanimated/plugin'],
};
128 changes: 128 additions & 0 deletions docs/docs/guides/12-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
title: Migration from Paper 5.x to 6.x
---

TBC

## Components

### TextInput

The Paper 6.x `TextInput` is a complete rewrite with a new API. Import the component the same way, but note that the props and behavior have changed significantly.

#### Types

```tsx
import { TextInput, type TextInputProps } from 'react-native-paper';
```

#### Variant

- **`mode="flat"`** → **`variant="filled"`**
- **`mode="outlined"`** → **`variant="outlined"`**

```tsx
// Before (v5)
<TextInput mode="flat" label="Filled" />
<TextInput mode="outlined" label="Outlined" />

// After (v6)
<TextInput variant="filled" label="Filled" />
<TextInput variant="outlined" label="Outlined" />
```

#### Adornments

- **`left` / `right`** → **`startAccessory` / `endAccessory`**
- **`TextInput.Affix`** → **`prefix` / `suffix`**, or **`TextInput.Icon`**, or **`startAccessory` / `endAccessory`**

```tsx
// Before (v5)
<TextInput
left={<TextInput.Icon icon="email" />}
right={<TextInput.Affix text={`${value.length}/80`} />}
/>

// After (v6)
<TextInput
startAccessory={(p) => <TextInput.Icon {...p} icon="email" />}
endAccessory={(p) => <CustomComponent {...p} />}
maxLength={100}
prefix="$"
suffix="/100"
counter
/>
```

#### Label and supporting text

- **`label: React.Element | string`** → **`string`**
- **`HelperText`** was removed; use **`supportingText`**.

```tsx
// Before (v5)
<>
<TextInput
label="Email"
error={hasError}
disabled={isDisabled}
/>
<HelperText type="error" visible={hasError}>
Enter a valid email
</HelperText>
</>

// After (v6)
<TextInput
label="Email"
error={hasError}
disabled={isDisabled}
supportingText="Enter a valid email"
/>
```

#### Removed props

No direct `TextInput` equivalents for:

- **`dense`**, **`contentStyle`**, **`underlineStyle`**
- **`underlineColor`**, **`activeUnderlineColor`**, **`outlineColor`**, **`activeOutlineColor`**, **`textColor`**

Use **`style`** on the inner input and the **`theme`** for colors.

```tsx
import { MD3LightTheme, TextInput } from 'react-native-paper';

const theme = {
...MD3LightTheme,
colors: {
...MD3LightTheme.colors,
outline: '#79747E',
primary: '#6750A4',
},
};

// Before (v5)
<TextInput
dense
contentStyle={{
paddingHorizontal: 12,
paddingTop: 8,
paddingBottom: 8,
}}
outlineStyle={{
borderRadius: 12,
borderWidth: 2,
}}
outlineColor="#79747E"
activeOutlineColor="#6750A4"
textColor="#1C1B1F"
style={{ fontSize: 16 }}
/>

// After (v6)
<TextInput
theme={theme}
style={{ fontSize: 16, color: '#1C1B1F' }}
/>
```
20 changes: 5 additions & 15 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ const config = {
AnimatedFAB: 'FAB/AnimatedFAB',
FABGroup: 'FAB/FABGroup',
},
HelperText: { HelperText: 'HelperText/HelperText' },
IconButton: {
IconButton: 'IconButton/IconButton',
},
Expand Down Expand Up @@ -165,8 +164,7 @@ const config = {
},
TextInput: {
TextInput: 'TextInput/TextInput',
TextInputAffix: 'TextInput/Adornment/TextInputAffix',
TextInputIcon: 'TextInput/Adornment/TextInputIcon',
TextInputIcon: 'TextInput/TextInputIcon',
},
ToggleButton: {
ToggleButton: 'ToggleButton/ToggleButton',
Expand Down Expand Up @@ -204,10 +202,9 @@ const config = {
}

const customUrls = {
TextInputAffix:
'src/components/TextInput/Adornment/TextInputAffix.tsx',
TextInputIcon:
'src/components/TextInput/Adornment/TextInputIcon.tsx',
TextInput: 'src/components/TextInput/TextInput.tsx',
TextInputIcon: 'src/components/TextInput/TextInputIcon.tsx',

Text: 'src/components/Typography/Text.tsx',
showcase: 'docs/src/components/Showcase.tsx',
};
Expand Down Expand Up @@ -326,14 +323,7 @@ const config = {
'https://snack.expo.dev/@react-native-paper/more-examples---snackbar-rendered-regardless-of-the-parent-positioning',
},
},
knownIssues: {
TextInput: {
'Outline overlaps label':
'https://github.com/callstack/react-native-paper/issues/3759#issuecomment-1601235262',
'Long text wraps to a second line':
'https://github.com/callstack/react-native-paper/issues/2581#issuecomment-790251987',
},
},
knownIssues: {},
themeColors,
screenshots,
extendedExamples,
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"color": "^4.2.3",
"marked": "^4.1.1",
"prism-react-renderer": "^1.3.5",
"process": "^0.11.10",
"react": "17.0.2",
"react-color": "^2.19.3",
"react-dom": "17.0.2",
Expand Down
9 changes: 9 additions & 0 deletions docs/plugins/docusaurus-react-native-plugin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');

module.exports = function () {
return {
Expand All @@ -17,6 +18,14 @@ module.exports = function () {
},
extensions: ['.web.js'],
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser.js',
}),
new webpack.DefinePlugin({
__DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
}),
],
};
},
};
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/BannerExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const BannerExample = () => {
/>
<TextInput
label="Email"
mode="outlined"
variant="outlined"
value={text}
onChangeText={(text) => setText(text)}
/>
Expand Down
16 changes: 14 additions & 2 deletions docs/src/components/PropTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,27 @@ const typeDefinitions = {
'https://github.com/callstack/react-native-paper/blob/main/src/components/Icon.tsx#L16',
ThemeProp:
'https://callstack.github.io/react-native-paper/docs/guides/theming#theme-properties',
'(props: TextInputAccessoryProps) => React.ReactNode':
'https://github.com/callstack/react-native-paper/blob/main/src/components/TextInput/TextInputIcon.tsx#L11',
'(props: TextInputRenderProps) => React.ReactNode':
'https://github.com/callstack/react-native-paper/blob/main/src/components/TextInput/TextInput.tsx#L168',
AccessibilityState:
'https://reactnative.dev/docs/accessibility#accessibilitystate',
'StyleProp<ViewStyle>': 'https://reactnative.dev/docs/view-style-props',
'StyleProp<TextStyle>': 'https://reactnative.dev/docs/text-style-props',
TextProps: 'https://reactnative.dev/docs/text#props',
AccessibilityProps:
'https://reactnative.dev/docs/accessibility#accessibilityprops',
};

const renderBadge = (annotation: string) => {
const [annotType, ...annotLabel] = annotation.split(' ');

// eslint-disable-next-line prettier/prettier
return `<span class="badge badge-${annotType.replace('@', '')} ">${annotLabel.join(' ')}</span>`;
return `<span class="badge badge-${annotType.replace(
'@',
''
)} ">${annotLabel.join(' ')}</span>`;
};

export default function PropTable({
Expand Down Expand Up @@ -56,7 +66,9 @@ export default function PropTable({
if (line.includes('@')) {
const annotIndex = line.indexOf('@');
// eslint-disable-next-line prettier/prettier
return `${line.substr(0, annotIndex)} ${renderBadge(line.substr(annotIndex))}`;
return `${line.substr(0, annotIndex)} ${renderBadge(
line.substr(annotIndex)
)}`;
} else {
return line;
}
Expand Down
9 changes: 2 additions & 7 deletions docs/src/data/screenshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ const screenshots = {
},
AnimatedFAB: 'screenshots/animated-fab.gif',
'FAB.Group': 'screenshots/fab-group.gif',
HelperText: 'screenshots/helper-text.gif',
Icon: 'screenshots/icon.png',
IconButton: {
default: 'screenshots/icon-button-1.png',
Expand Down Expand Up @@ -147,13 +146,9 @@ const screenshots = {
},
Text: 'screenshots/typography.png',
TextInput: {
'flat (focused)': 'screenshots/textinput-flat.focused.png',
'flat (disabled)': 'screenshots/textinput-flat.disabled.png',
'outlined (focused)': 'screenshots/textinput-outlined.focused.png',
'outlined (disabled)': 'screenshots/textinput-outlined.disabled.png',
filled: 'screenshots/text-field-filled.png',
outlined: 'screenshots/text-field-outlined.png',
},
'TextInput.Affix': 'screenshots/textinput-outline.affix.png',
'TextInput.Icon': 'screenshots/textinput-flat.icon.png',
ToggleButton: 'screenshots/toggle-button.png',
'ToggleButton.Group': 'screenshots/toggle-button-group.gif',
'ToggleButton.Row': 'screenshots/toggle-button-row.gif',
Expand Down
11 changes: 0 additions & 11 deletions docs/src/data/themeColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,6 @@ const themeColors = {
'textColor/iconColor': 'theme.colors.primary',
},
},
HelperText: {
disabled: {
textColor: 'theme.colors.onSurfaceDisabled',
},
default: {
textColor: 'theme.colors.onSurfaceVariant',
},
error: {
textColor: 'theme.colors.error',
},
},
IconButton: {
selected: {
default: {
Expand Down
Binary file added docs/static/screenshots/text-field-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/screenshots/text-field-outlined.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading