import * as React from "react"; import { View, ViewStyle, StyleProp } from "react-native"; import Surface from "../Surface"; import type { $RemoveChildren } from "../types"; import { DefaultTheme } from "styled-components"; declare type Props = $RemoveChildren & { /** * Whether banner is currently visible. */ visible: boolean; /** * Content that will be displayed inside banner. */ children: string; /** * Icon to display for the `Banner`. Can be an image. */ icon?: React.ReactElement; /** * Action items to shown in the banner. * An action item should contain the following properties: * * - `label`: label of the action button (required) * - `onPress`: callback that is called when button is pressed (required) * * To customize button you can pass other props that button component takes. */ actions: Array<{ label: string; onPress: () => void; }>; /** * Style of banner's inner content. * Use this prop to apply custom width for wide layouts. */ contentStyle?: StyleProp; style?: StyleProp; ref?: React.RefObject; /** * @optional */ theme?: DefaultTheme; }; /** * Banner displays a prominent message and related actions. * *
* *
* * ## Usage * ```js * import * as React from 'react'; * import { Image } from 'react-native'; * import Banner from 'react-native-simple-elements/components/Banner'; * * const MyComponent = () => { * const [visible, setVisible] = React.useState(true); * * return ( * setVisible(false), * }, * { * label: 'Learn more', * onPress: () => setVisible(false), * }, * ]} * icon={({size}) => ( * * )}> * There was a problem processing a transaction on your credit card. * * ); * }; * * export default MyComponent; * ``` */ declare const Banner: ({ visible, icon, children, actions, contentStyle, style, ...rest }: Props) => JSX.Element; export default Banner;