diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 64a049a63d..99f1188c1c 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -130,6 +130,10 @@ export type Props = $Omit, 'mode'> & { * Specifies the largest possible scale a text font can reach. */ maxFontSizeMultiplier?: number; + /** + * Label text number Of Lines of the button. + */ + numberOfLines?: number; style?: Animated.WithAnimatedValue>; /** * Style for the button text. @@ -186,6 +190,7 @@ const Button = ( onPressOut, onLongPress, delayLongPress, + numberOfLines, style, theme: themeOverrides, uppercase: uppercaseProp, @@ -266,6 +271,7 @@ const Button = ( const borderRadius = (isV3 ? 5 : 1) * roundness; const iconSize = isV3 ? 18 : 16; + const NumberOfLines = numberOfLines ? numberOfLines : 1; const { backgroundColor, borderColor, textColor, borderWidth } = getButtonColors({ @@ -383,7 +389,7 @@ const Button = ( - + ) : null} diff --git a/src/components/SegmentedButtons/SegmentedButtons.tsx b/src/components/SegmentedButtons/SegmentedButtons.tsx index e5ab79629f..1558dc5ac6 100644 --- a/src/components/SegmentedButtons/SegmentedButtons.tsx +++ b/src/components/SegmentedButtons/SegmentedButtons.tsx @@ -53,6 +53,7 @@ export type Props = { * - `icon`: icon to display for the item * - `disabled`: whether the button is disabled * - `accessibilityLabel`: acccessibility label for the button. This is read by the screen reader when the user taps the button. + * - `numberOfLines`: label text number of lines of the button * - `checkedColor`: custom color for checked Text and Icon * - `uncheckedColor`: custom color for unchecked Text and Icon * - `onPress`: callback that is called when button is pressed @@ -66,6 +67,7 @@ export type Props = { icon?: IconSource; disabled?: boolean; accessibilityLabel?: string; + numberOfLines?: number; checkedColor?: string; uncheckedColor?: string; onPress?: (event: GestureResponderEvent) => void; @@ -79,6 +81,7 @@ export type Props = { * Density is applied to the height, to allow usage in denser UIs */ density?: 'regular' | 'small' | 'medium' | 'high'; + animated?: boolean; style?: StyleProp; theme?: ThemeProp; } & ConditionalValue; @@ -132,6 +135,7 @@ const SegmentedButtons = ({ buttons, multiSelect, density, + animated, style, theme: themeOverrides, }: Props) => { @@ -172,6 +176,7 @@ const SegmentedButtons = ({ {...item} key={i} checked={checked} + animated={animated} segment={segment} density={density} onPress={onPress}