MCPcopy Index your code
hub / github.com/callstack/react-native-paper / InputLabel

Function InputLabel

src/components/TextInput/Label/InputLabel.tsx:15–208  ·  view source on GitHub ↗
(props: InputLabelProps)

Source from the content-addressed store, hash-verified

13import type { InputLabelProps } from '../types';
14
15const InputLabel = (props: InputLabelProps) => {
16 const {
17 labeled,
18 wiggle,
19 error,
20 focused,
21 opacity,
22 labelLayoutWidth,
23 labelLayoutHeight,
24 labelBackground,
25 label,
26 labelError,
27 onLayoutAnimatedText,
28 onLabelTextLayout,
29 hasActiveOutline,
30 activeColor,
31 placeholderStyle,
32 baseLabelTranslateX,
33 baseLabelTranslateY,
34 font,
35 fontSize,
36 lineHeight,
37 fontWeight,
38 placeholderOpacity,
39 wiggleOffsetX,
40 labelScale,
41 topPosition,
42 paddingLeft,
43 paddingRight,
44 backgroundColor,
45 roundness,
46 placeholderColor,
47 errorColor,
48 labelTranslationXOffset,
49 maxFontSizeMultiplier,
50 testID,
51 isV3,
52 inputContainerLayout,
53 scaledLabel,
54 } = props;
55
56 const { INPUT_PADDING_HORIZONTAL } = getConstants(isV3);
57 const { width } = useWindowDimensions();
58
59 const isWeb = Platform.OS === 'web';
60
61 const paddingOffset =
62 paddingLeft && paddingRight ? { paddingLeft, paddingRight } : {};
63
64 const labelTranslationX = {
65 transform: [
66 {
67 // Offset label scale since RN doesn't support transform origin
68 translateX: labeled.interpolate({
69 inputRange: [0, 1],
70 outputRange: [baseLabelTranslateX, labelTranslationXOffset || 0],
71 }),
72 },

Callers

nothing calls this directly

Calls 1

getConstantsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…