Banner
Inline banner notice with caller-owned visibility and composable title, description, and actions.
Install
First install? Set up the registry in your app.
npx --yes --package=https://native.uipkge.dev/cli/uipkge-native-0.1.1.tgz uipkge-native add bannerSource files
Expand a file to read the source the installer copies into your app.
components/ui/banner/Banner.tsx
import * as React from 'react'
import { View } from 'react-native'
import { Alert, type AlertProps } from '@/components/ui/alert'
import { cn } from '@/lib/utils'
export interface BannerProps extends AlertProps {
visible?: boolean
}
export const Banner = React.forwardRef<React.ComponentRef<typeof View>, BannerProps>(
({ visible = true, className, ...props }, ref) =>
visible ? <Alert ref={ref} className={cn('bg-secondary', className)} {...props} /> : null,
)
Banner.displayName = 'Banner'
export {
AlertTitle as BannerTitle,
AlertDescription as BannerDescription,
AlertActions as BannerActions,
} from '@/components/ui/alert'
components/ui/banner/index.ts
export * from './Banner'