Ir a contenido
Crea una cuenta o inicia sesión
Logotipo de la documentación de Stripe
/
Pregúntale a la IA
Crear cuentaIniciar sesión
Empezar
Pagos
Ingresos
Plataformas y marketplaces
Gestión del dinero
Recursos para desarrolladores
API y SDKAyuda
Resumen
Control de versiones
Registro de cambios
Actualiza tu versión de la API
Mejora tu versión de SDK
Essentials
SDK
API
Pruebas
CLI de Stripe
Proyectos de muestra
Herramientas
Dashboard de Stripe
Espacio de trabajo
Dashboard de desarrolladores
Stripe para Visual Studio Code
Terraform
Funciones
Flujos de trabajo
Destinos de eventos
Alertas de estado de StripeCargas de archivos
Soluciones de IA
Kit de herramientas para agentes
Protocolo de Contexto del ModeloCrea flujos de trabajo para la facturación SaaS con IA agéntica
Seguridad y privacidad
Seguridad
Rastreo web de Stripebot
Privacidad
Ampliar Stripe
Desarrolla aplicaciones de Stripe
    Resumen
    Empezar
    Crear una aplicación
    Cómo funciona Stripe Apps
    Aplicaciones de muestra
    Crea tu propia aplicación
    Almacenar secretos
    Métodos de autenticación de API
    Flujos de autorización
    Lógica del lado del servidor
    Escucha los eventos
    Gestionar diferentes modos
    Habilita un entorno de prueba
    Habilitar el acceso a la red local
    Página de Configuración de la aplicación
    Crea una interfaz de usuario
    Onboarding
    Distribuye tu aplicación
    Opciones de distribución
    Cargar tu aplicación
    Versiones y lanzamientos
    Probar tu aplicación
    Publica tu aplicación
    Promociona tu aplicación
    Añadir vínculos profundos
    Crear enlaces de instalación
    Asignar funciones en las extensiones de interfaz de usuario
    Acciones posteriores a la instalación
    Análisis de la aplicación
    Componentes integrados
    Integra Stripe Apps de terceros
    Migración a Stripe Apps
    Migra o desarrolla una extensión
    Migrar un plugin a Stripe Apps o Stripe Connect
    Referencia
    Manifiesto de aplicación
    CLI
    SDK de extensión
    Permisos
    Ventanas
    Patrones de diseño
    Componentes
      Acordeón
      Distintivo
      Banner
      BarChart
      Casilla
      Botón
      ButtonGroup
      Casilla de verificación
      Chip
      ContextView
      DateField
      DetailPageModule
      DetailPagePropertyList
      DetailPageTable
      Divisor
      FocusView
      FormFieldGroup
      Icono
      Img
      Alineado
      LineChart
      Link
      Lista
      Menú
      Vista de Onboarding
      PropertyList
      Radio
      Seleccionar
      SettingsView
      SignInView
      Sparkline
      Indicador giratorio
      Cambiar
      Mesa
      Pestañas
      Lista de tareas
      TextArea
      TextField
      Aviso
      Información sobre herramientas
Usa aplicaciones de Stripe
Socios
Ecosistema de socios
Certificación de socio
Estados Unidos
Español (España)
InicioRecursos para desarrolladoresBuild Stripe appsComponents

Img component for Stripe Apps

Display images with the Img UI component.

To add an image to your app:

  1. Import the Img component:
import {Img} from '@stripe/ui-extension-sdk/ui';
  1. Include the base URLs of any images you include in the image-src section of the content_security_policy in your app manifest.

The following shows a preview of an image with the respective Img tag below:

Cargando ejemplo...
<Img src="https://images.example.com/gross-volume.svg" width="484" height="207" alt="Gross volume" />

Img props

PropiedadTipo

alt

Opcional

string | undefined

The alternative text of the image.

crossOrigin

Opcional

"anonymous" | undefined

Cross-origin support for the image.

height

Opcional

(string | number) | undefined

The height of the image.

sizes

Opcional

string | undefined

The sizes of the image (for use with srcSet).

src

Opcional

string | undefined

The source of the image.

srcSet

Opcional

string | undefined

The source set of the image.

width

Opcional

(string | number) | undefined

The width of the image.

SrcSet

You can use srcSet for responsive images.

The example below uses the size attribute to define the maximum width of the specified image:

Cargando ejemplo...
<Img srcSet="https://images.example.com/daily-sales.jpg 480w, https://images.example.com/daily-sales-large.jpg 800w" sizes="(max-width: 600px) 480px, 800px" width="484" height="207" alt="Daily sales" />

Data URLs

You can co-locate images with your UI extension code and load them directly into the Img component. Supported formats are GIF, JPEG, SVG, PNG, and WEBP.

We recommend using SVG for most common use-cases like icons and other way finding illustrations. You must include the suffix of the image in the require or import statement.

Cargando ejemplo...
import {Img} from '@stripe/ui-extension-sdk/ui'; import CommunityIcon from './community-icon.svg'; const DataURl = () => ( <Img width="75" height="75" src={CommunityIcon} alt="Community" /> )

Styling

You can achieve certain styling effects for Img components by wrapping them with a styled Box component.

Borders

To add a border to an Img, use the CSS keyline property, along with width and display to contain the image:

Cargando ejemplo...
<Box css={{ keyline: 'critical', width: 'fit', stack: 'x', }} > <Img src="https://images.example.com/gross-margin.svg" width="484" height="207" alt="Gross margin" /> </Box>

Rounded corners

To add rounded corners to an Img, use the CSS borderRadius property, along with overflow, width, and display to contain the image:

Cargando ejemplo...
<Box css={{ borderRadius: 'rounded', overflow: 'hidden', width: 'fit', stack: 'x', }} > <Img src="https://images.example.com/gross-margin.svg" width="484" height="207" alt="Gross margin" /> </Box>

También podría interesarte...

  • Design patterns to follow
  • Style your app
  • UI testing
¿Te ha sido útil la página?
SíNo
  • ¿Necesitas ayuda? Ponte en contacto con el equipo de soporte.
  • Echa un vistazo a nuestro registro de cambios.
  • ¿Tienes alguna pregunta? Ponte en contacto con el equipo de ventas.
  • ¿LLM? Lee llms.txt.
  • Con tecnología de Markdoc