-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathCaption.tsx
More file actions
50 lines (45 loc) · 1.03 KB
/
Caption.tsx
File metadata and controls
50 lines (45 loc) · 1.03 KB
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
42
43
44
45
46
47
48
49
50
import * as React from 'react';
import { Text, TextStyle, StyleSheet, StyleProp } from 'react-native';
import StyledText from './StyledText';
export type Props = React.ComponentProps<typeof Text> & {
style?: StyleProp<TextStyle>;
children: React.ReactNode;
};
// @component-group Typography
/**
* @deprecated Deprecated in v5.x - use `<Text variant="bodySmall" />` instead.
* Typography component for showing a caption.
*
* <div class="screenshots">
* <img src="screenshots/caption.png" />
* </div>
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Caption } from 'react-native-paper';
*
* const MyComponent = () => (
* <Caption>Caption</Caption>
* );
*
* export default MyComponent;
* ```
*/
const Caption = (props: Props) => (
<StyledText
{...props}
alpha={0.54}
family="regular"
style={[styles.text, props.style]}
/>
);
export default Caption;
const styles = StyleSheet.create({
text: {
fontSize: 12,
lineHeight: 20,
marginVertical: 2,
letterSpacing: 0.4,
},
});