Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
Versioning
Changelog
Upgrade your API version
Upgrade your SDK version
Developer tools
SDKs
API
Testing
Workbench
Event Destinations
Workflows
Stripe CLI
Stripe Shell
Developers Dashboard
Agent toolkit
Build with LLMsStripe for Visual Studio CodeStripe health alertsFile uploads
Security and privacy
Security
Extend Stripe
Stripe Apps
    Overview
    Get started
    Create an app
    How Stripe Apps work
    Sample apps
    Build an app
    Store secrets
    API authentication methods
    Authorization flows
    Server-side logic
    Listen to events
    Handle different modes
    Enable sandbox support
    App settings page
    Build a UI
    Onboarding
    Distribute your app
    Distribution options
    Upload your app
    Versions and releases
    Test your app
    Publish your app
    Promote your app
    Add deep links
    Create install links
    Assign roles in UI extensions
    Post-install actions
    App analytics
    Embedded components for Apps
    Embed third-party Stripe Apps
    Migrating to Stripe Apps
    Migrate or build an extension
    Migrate a plugin to Stripe Apps or Stripe Connect
    Reference
    App manifest
    CLI
    Extension SDK
    Permissions
    Viewports
    Design patterns
    Components
      Accordion
      Badge
      Banner
      BarChart
      Box
      Button
      ButtonGroup
      Checkbox
      Chip
      ContextView
      DateField
      Divider
      FocusView
      FormFieldGroup
      Icon
      Img
      Inline
      LineChart
      Link
      List
      Menu
      PropertyList
      Radio
      Select
      SettingsView
      SignInView
      Sparkline
      Spinner
      Switch
      Table
      Tabs
      Tasklist
      TextArea
      TextField
      Toast
      Tooltip
Stripe Connectors
Partners
Partner ecosystem
Partner certification
HomeDeveloper toolsStripe AppsComponents

Banner component for Stripe Apps

Use the Banner to show a variety of alerts or messages you want to make explicit to the user.

Copy page

To add the Banner component to your app:

import {Banner} from '@stripe/ui-extension-sdk/ui';

Overview

Banners take up the width of their parent container. Banners are suitable for important information requiring user input and persistent display.

Banners come with three preset types:

  • Default
  • Caution
  • Critical

The following shows a preview of the three preset types for a banner:

Loading example...
<Box css={{stack: 'y', gap: 'medium', width: 'fill'}}> <Banner type="default" onDismiss={() => console.log('hello world')} title="Neutral title" description="A short description" actions={ <Button onPress={() => console.log('hello world')}>Button</Button> } /> <Banner type="caution" title="Check your bank details" description="Your bank account information must be verified before receiving payouts." onDismiss={() => console.log('hello world')} actions={ <Box css={{stack: 'x', gap: 'small'}}> <Button onPress={() => console.log('hello world')}> Update bank account </Button> <Button onPress={() => console.log('hello world')}> Learn more </Button> </Box> } /> <Banner type="critical" title="Check your bank details" description="Your bank account information must be verified before receiving payouts." actions={ <Button onPress={() => console.log('hello world')}> Update bank account </Button> } /> </Box>

Banner props

PropertyType

actions

Optional

React.ReactNode

description

Optional

React.ReactNode

onDismiss

Optional

(() => void) | undefined

title

Optional

React.ReactNode

type

Optional

("default" | "caution" | "critical") | undefined

onDismiss

Banners have the option of adding a dismiss button—add a click handler to onDismiss for the Hide Banner button to appear:

Loading example...
const [open, setOpen] = React.useState(true); return ( <Box css={{stack: 'y', gap: 'medium', width: 'fill'}}> <Button onPress={() => setOpen(!open)}> {open ? 'Hide' : 'Show'} Banner </Button> {open && ( <Banner type="default" onDismiss={() => setOpen(false)} title="Neutral title" description="A short description" actions={ <Button onPress={() => console.log('hello world')}>Button</Button> } /> )} </Box> )

Actions

Banners also take an actions prop that allows you to add action buttons to the Banner:

Loading example...
<Box css={{width: 'fill'}}> <Banner type="default" title="Check your bank details" description="Your bank account information must be verified before receiving payouts." actions={ <Button onPress={() => console.log('hello world')}> Update bank account </Button> } /> </Box>

See also

  • Design patterns to follow
  • Style your app
  • UI testing
Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc