React Native MantineInputs

InputBase

Standard input frame around arbitrary content

Import: import { InputBase } from 'react-native-mantine';

Usage

import { InputBase, Pill, Group } from 'react-native-mantine';

// Custom content inside the input frame
<InputBase label="Technologies" multiline>
  <Group spacing={4}>
    <Pill size="sm">React</Pill>
    <Pill size="sm">React Native</Pill>
  </Group>
</InputBase>

// Pressable frame for picker-like inputs
<InputBase
  label="Pick a value"
  onPress={() => openPicker()}
  rightSection={<Icon name="chevron-down" size={12} />}
>
  <Text size="sm">{value ?? 'Nothing selected'}</Text>
</InputBase>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the input frame
labelReact.ReactNodeInput label
descriptionReact.ReactNodeInput description
errorReact.ReactNodeError message
size'xs' | 'sm' | 'md' | 'lg' | 'xl'"sm"Controls input height and font size
radiusMantineNumberSize"sm"Key of theme.radius or any valid value to set border-radius
iconReact.ReactNodeIcon displayed on the left side of input
rightSectionReact.ReactNodeRight section of input
rightSectionWidthnumberRight section width
requiredbooleanfalseDisplays required asterisk
variant'default' | 'filled' | 'unstyled'"default"Input variant
disabledbooleanfalseDisables interaction and dims the input
multilinebooleanfalseAllows the frame to grow with its content instead of a fixed height
onPress() => voidCalled when the input frame is pressed, makes the frame pressable
wrapperStyleStyleProp<ViewStyle>Input wrapper style
accessibilityLabelstringAccessibility label of the pressable frame

Source on GitHub · npm