react-native-input-code-otp
Version:
react-native-input-code-otp is a high-performance and fully customizable OTP input component for React Native, inspired by @shadcn/ui.
32 lines (31 loc) • 877 B
JavaScript
import { View, StyleSheet } from 'react-native';
import { TextInputOTPProvider } from "../hooks/use-text-input-otp.js";
import { TextInput } from "./text-input.js";
import { forwardRef } from 'react';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export const TextInputOTP = /*#__PURE__*/forwardRef(({
children,
containerStyles,
...rest
}, ref) => {
return /*#__PURE__*/_jsx(TextInputOTPProvider, {
...rest,
children: /*#__PURE__*/_jsxs(View, {
style: StyleSheet.flatten([styles.container, containerStyles]),
children: [/*#__PURE__*/_jsx(TextInput, {
ref: ref,
...rest
}), children]
})
});
});
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 10
}
});
//# sourceMappingURL=text-input-otp.js.map
;