Basic

<BackgroundImage
  src="https://example.com/photo.jpg"
  style="height:180px;width:100%"
/>

With radius

<BackgroundImage
  src="https://example.com/photo.jpg"
  radius="md"
  style="height:180px;width:100%"
/>

With overlay children

Caption over image

<BackgroundImage
  src="https://example.com/photo.jpg"
  radius="md"
  style="height:180px;display:flex;align-items:flex-end;padding:var(--dv-spacing-md)"
>
  <Text c="white" fw={700} size="lg">Caption over image</Text>
</BackgroundImage>

Props

PropTypeDefaultDescription
srcstring—URL of the background image (required)
radius'xs'|'sm'|'md'|'lg'|'xl'|string—Corner radius token or CSS value
componentstring'div'HTML element to render as the root node
classstring—Additional CSS class names
styleobject—Inline styles merged with generated styles
childrenReactNode—Content overlaid on the background image