diff --git a/README.md b/README.md index 9e77fb2..83c56f0 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ export default () => ( - [style](#style) - [visible (from Popover)](#visible) - [wrapperStyle](#wrapperStyle) + - [caretStyle](#caretStyle) #### Popable.children @@ -163,6 +164,15 @@ Style the wrapping `View` component using any [`View` style property](https://re @morning_cafe ``` +#### caretStyle + +Style the caret component using any [`View` style property](https://reactnative.dev/docs/view-style-props). + +```jsx +@morning_cafe +``` + + ### Popover The UI component in `Popable` can also be used on its own. diff --git a/src/Popable.tsx b/src/Popable.tsx index 75f214e..d0400b0 100644 --- a/src/Popable.tsx +++ b/src/Popable.tsx @@ -35,6 +35,7 @@ export type PopableProps = { style?: PopoverProps['style']; visible?: boolean; wrapperStyle?: ViewProps['style']; + caretStyle?: ViewProps['style']; }; const DEFAULT_LAYOUT = { @@ -61,6 +62,7 @@ const Popable = forwardRef(function Popable( style, visible, wrapperStyle, + caretStyle, }, ref ) { @@ -223,6 +225,7 @@ const Popable = forwardRef(function Popable( (function Popover( forceInitialAnimation = false, numberOfLines, visible = true, + caretStyle = null, position = 'bottom', style, ...extraProps @@ -84,7 +86,7 @@ const Popover = React.forwardRef(function Popover( align={caretPosition} position={position} backgroundColor={backgroundColor} - style={styles.caret} + style={[styles.caret, caretStyle]} /> );