carbon-react
Version:
A library of reusable React components for easily building user interfaces.
43 lines (42 loc) • 2.46 kB
TypeScript
import { MarginProps, BackgroundProps, LayoutProps, PaddingProps } from "styled-system";
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
export type PositionProps = "absolute" | "fixed" | "relative" | "static" | "sticky";
export interface StyledImageProps extends BackgroundProps, LayoutProps, MarginProps, PaddingProps, TagProps {
/** HTML alt property to display when an img fails to load */
alt?: string;
/** Prop to specify if the image is decorative */
decorative?: boolean;
/** Any valid file path, passing this will render the component as an img element */
src?: string;
/** HTML hidden property to indicate whether to remain hidden visually and from screen readers */
hidden?: boolean;
/** Children elements, will only render if component is a div element */
children?: React.ReactNode;
/** Any valid CSS string for position */
position?: PositionProps;
/** Any valid CSS string for top */
top?: string;
/** Any valid CSS string for right */
right?: string;
/** Any valid CSS string for bottom */
bottom?: string;
/** Any valid CSS string for left */
left?: string;
}
declare const StyledImage: import("styled-components").StyledComponent<"div", any, {
theme: object;
} & {
children: import("react").ReactNode;
src: string | undefined;
hidden: boolean;
position: PositionProps | undefined;
top: string | undefined;
right: string | undefined;
bottom: string | undefined;
left: string | undefined;
as?: string | undefined;
backgroundPosition: import("styled-system").ResponsiveValue<import("csstype").Property.BackgroundPosition<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>;
backgroundRepeat: import("styled-system").ResponsiveValue<import("csstype").Property.BackgroundRepeat, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>;
backgroundSize: import("styled-system").ResponsiveValue<import("csstype").Property.BackgroundSize<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>;
} & StyledImageProps, "theme" | "children" | "hidden" | "src" | "as" | "left" | "right" | "position" | "bottom" | "top" | "backgroundSize" | "backgroundPosition" | "backgroundRepeat">;
export { StyledImage };