Usage
Use BackgroundImage component when you need to display the image behind any content.
Component sets background-image to given src, background-size to cover and background-position to center.
It can be used for cards, hero headers and similar components:
BackgroundImage component can be used to add any content on image. It is useful for hero headers and other similar sections
Radius
xs
sm
md
lg
xl
Custom root element
BackgroundImage is a polymorphic component, you can change root element by setting component prop:
Accessibility
BackgroundImage component sets background-image, it is ignored by screen readers,
if this is not a desired behavior, use Image component instead.
BackgroundImage component props
| Name | Type | Description |
|---|---|---|
| radius | number | "xs" | "sm" | "md" | "lg" | "xl" | Key of theme.radius or number to set border-radius in px |
| src * | string | Image url |