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
srcstringURL of the background image (required)
radius'xs'|'sm'|'md'|'lg'|'xl'|stringCorner radius token or CSS value
componentstring'div'HTML element to render as the root node
classstringAdditional CSS class names
styleobjectInline styles merged with generated styles
childrenReactNodeContent overlaid on the background image