forked from mrzachnugent/react-native-reusables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextarea.tsx
41 lines (37 loc) · 1.08 KB
/
textarea.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React from 'react';
import { TextInput } from 'react-native';
import { cn } from '~/lib/utils';
const Textarea = React.forwardRef<
React.ElementRef<typeof TextInput>,
React.ComponentPropsWithoutRef<typeof TextInput>
>(
(
{
className,
editable = true,
multiline = true,
numberOfLines = 4,
placeholderClassName,
...props
},
ref
) => {
return (
<TextInput
ref={ref}
className={cn(
'rounded-md border border-input bg-background p-3 native:text-lg h-28 leading-[1.25] text-foreground items-center ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className
)}
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
editable={editable}
multiline={multiline}
numberOfLines={numberOfLines}
textAlignVertical='top'
{...props}
/>
);
}
);
Textarea.displayName = 'Textarea';
export { Textarea };