|
| 1 | +{ |
| 2 | + "name": "TextField", |
| 3 | + "category": "incubator", |
| 4 | + "description": "An enhanced customizable TextField with validation support", |
| 5 | + "extends": ["TextInput"], |
| 6 | + "extendsLink": ["https://reactnative.dev/docs/textinput"], |
| 7 | + "modifiers": ["margin", "color", "typography"], |
| 8 | + "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/incubatorScreens/IncubatorTextFieldScreen.tsx", |
| 9 | + "images": [ |
| 10 | + "https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Incubator.TextField/FloatingPlaceholder.gif?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Incubator.TextField/Validation.gif?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Incubator.TextField/ColorByState.gif?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Incubator.TextField/CharCounter.gif?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Incubator.TextField/Hint.gif?raw=true" |
| 11 | + ], |
| 12 | + "props": [ |
| 13 | + {"name": "label", "type": "string", "description": "Field label"}, |
| 14 | + { |
| 15 | + "name": "labelColor", |
| 16 | + "type": "ColorType", |
| 17 | + "description": "Field label color. Either a string or color by state map ({default, focus, error, disabled})" |
| 18 | + }, |
| 19 | + {"name": "labelStyle", "type": "TextStyle", "description": "Custom style for the field label"}, |
| 20 | + {"name": "labelProps", "type": "TextProps", "description": "Pass extra props to the label Text element"}, |
| 21 | + {"name": "floatingPlaceholder", "type": "boolean", "description": "Pass to add floating placeholder support"}, |
| 22 | + { |
| 23 | + "name": "floatingPlaceholderStyle", |
| 24 | + "type": "TextStyle", |
| 25 | + "description": "Custom style for the floating placeholder" |
| 26 | + }, |
| 27 | + {"name": "leadingAccessory", "type": "ReactElement", "description": "Pass to render a leading element"}, |
| 28 | + {"name": "trailingAccessory", "type": "ReactElement", "description": "Pass to render a trailing element"}, |
| 29 | + {"name": "enableErrors", "type": "boolean", "description": "Should support showing validation error message"}, |
| 30 | + { |
| 31 | + "name": "validate", |
| 32 | + "type": "Validator | Validator[]", |
| 33 | + "description": "A single or multiple validator. Can be a string (required, email) or custom function." |
| 34 | + }, |
| 35 | + { |
| 36 | + "name": "validationMessage", |
| 37 | + "type": "string | string[]", |
| 38 | + "description": "The validation message to display when field is invalid (depends on validate)" |
| 39 | + }, |
| 40 | + { |
| 41 | + "name": "validationMessagePosition", |
| 42 | + "type": "ValidationMessagePosition", |
| 43 | + "description": "The position of the validation message (top/bottom)" |
| 44 | + }, |
| 45 | + {"name": "validationMessageStyle", "type": "TextStyle", "description": "Custom style for the validation message"}, |
| 46 | + {"name": "validateOnStart", "type": "boolean", "description": "Should validate when the TextField mounts"}, |
| 47 | + {"name": "validateOnChange", "type": "boolean", "description": "Should validate when the TextField value changes"}, |
| 48 | + {"name": "validateOnBlur", "type": "boolean", "description": "Should validate when losing focus of TextField"}, |
| 49 | + { |
| 50 | + "name": "onChangeValidity", |
| 51 | + "type": "(isValid: boolean) => void", |
| 52 | + "description": "Callback for when field validity has changed" |
| 53 | + }, |
| 54 | + { |
| 55 | + "name": "fieldStyle", |
| 56 | + "type": "ViewStyle | (context: FieldContextType, props) => ViewStyle", |
| 57 | + "description": "Internal style for the field container" |
| 58 | + }, |
| 59 | + {"name": "containerStyle", "type": "ViewStyle", "description": "Container style of the whole component"}, |
| 60 | + { |
| 61 | + "name": "preset", |
| 62 | + "type": "'default' | null | string", |
| 63 | + "description": "Predefined preset to use for styling the field" |
| 64 | + }, |
| 65 | + { |
| 66 | + "name": "showCharCounter", |
| 67 | + "type": "boolean", |
| 68 | + "description": "Should show a character counter (works only with maxLength)" |
| 69 | + }, |
| 70 | + {"name": "charCounterStyle", "type": "TextStyle", "description": "Pass custom style to character counter text"}, |
| 71 | + {"name": "placeholder", "type": "string", "description": "The placeholder for the field"}, |
| 72 | + {"name": "floatingPlaceholderColor", "type": "ColorType", "description": "The floating placeholder color"}, |
| 73 | + { |
| 74 | + "name": "floatingPlaceholderStyle", |
| 75 | + "type": "TextStyle", |
| 76 | + "description": "Custom style to pass to the floating placeholder" |
| 77 | + }, |
| 78 | + { |
| 79 | + "name": "floatOnFocus", |
| 80 | + "type": "boolean", |
| 81 | + "description": "Should placeholder float on focus or when start typing" |
| 82 | + }, |
| 83 | + {"name": "hint", "type": "string", "description": "A hint text to display when focusing the field"}, |
| 84 | + {"name": "color", "type": "ColorType", "description": "Input color"}, |
| 85 | + {"name": "placeholderTextColor", "type": "ColorType", "description": "Placeholder text color"}, |
| 86 | + { |
| 87 | + "name": "formatter", |
| 88 | + "type": "(value) => string | undefined", |
| 89 | + "description": "Custom formatter for the input value (used only when input if not focused)" |
| 90 | + } |
| 91 | + ] |
| 92 | +} |
0 commit comments