UNPKG

@cn-ui/core

Version:

The @cn-ui/core is a collection of UI components and utilities for building modern web applications with SolidJS.

34 lines (33 loc) 1.27 kB
import { type JSX } from "solid-js"; import { type JSXSlot } from "@cn-ui/reactive"; export type ImageFit = "contain" | "cover" | "fill" | "none" | "scale-down"; export type ImagePosition = "center" | "top" | "right" | "bottom" | "left" | string; export interface ImageProps extends JSX.HTMLAttributes<HTMLImageElement> { src: string; alt: string; fit?: ImageFit; position?: ImagePosition; round?: boolean; block?: boolean; width?: number; height?: number; /** * @example [ * [ * "https://plus.unsplash.com/premium_photo-1674939148088-d71acc1541ff?w=100&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxfHx8ZW58MHx8fHx8", * 100, * ], * [ * "https://plus.unsplash.com/premium_photo-1674939148088-d71acc1541ff?w=200&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxfHx8ZW58MHx8fHx8", * 200, * ], * ] */ srcSets?: [string, number][]; radius?: number; fallback?: string | JSXSlot; } /** * 图片预设组件 */ export declare const Image: import("solid-js").Component<import("@cn-ui/reactive").OriginComponentOutputType<ImageProps, HTMLImageElement, string>>;