UNPKG

@re-flex/ui

Version:
14 lines (13 loc) 515 B
import SXBase from "@re-flex/styled/SX"; import { styled } from "@re-flex/styles"; import React from "react"; const BGImageBase = styled(SXBase)(({ bgImage, aspectRatio }) => ({ aspectRatio: aspectRatio, backgroundImage: bgImage, backgroundRepeat: "no-repeat", backgroundSize: "100%", })); const BGImage = ({ bgImage, aspectRatio = "16/9", ...props }) => { return (React.createElement(BGImageBase, { ...props, bgImage: `url(${bgImage})`, aspectRatio: aspectRatio })); }; export default BGImage;