@heybox/hb-sdk API Reference - v0.9.5
    正在准备搜索索引...

    接口 ImageOptions

    image 节点的可选项。

    interface ImageOptions {
        appearance?: "default" | "deemphasized";
        aspectRatio?: string;
        fallback?: { icon?: string; source?: "app-ambient"; text?: string };
        fit?: "cover" | "contain";
        id?: string;
        overlay?:
            | "none"
            | "scrim"
            | "gradientBottom"
            | "gradientTopBottom"
            | "fadeBottom"
            | "fadeBottomContent"
            | "fadeBottomEdge";
        radius?: "none"
        | "sm"
        | "md"
        | "lg"
        | "full";
        size?:
            | "content"
            | "sm"
            | "md"
            | "lg"
            | "hero"
            | "thumb"
            | "xl"
            | "feature"
            | "landscape-compact"
            | "landscape-content";
    }
    索引

    属性

    appearance?: "default" | "deemphasized"

    呈现强度;deemphasized 由宿主统一弱化,不改变图片本身。

    aspectRatio?: string

    宽高比,例如 16/9。

    fallback?: { icon?: string; source?: "app-ambient"; text?: string }

    缺失或加载失败时的回退表达。

    fit?: "cover" | "contain"

    填充方式。

    id?: string

    稳定键。

    overlay?:
        | "none"
        | "scrim"
        | "gradientBottom"
        | "gradientTopBottom"
        | "fadeBottom"
        | "fadeBottomContent"
        | "fadeBottomEdge"

    遮罩;在图片之上叠加文字时保证对比度。

    radius?: "none" | "sm" | "md" | "lg" | "full"

    圆角档位。

    size?:
        | "content"
        | "sm"
        | "md"
        | "lg"
        | "hero"
        | "thumb"
        | "xl"
        | "feature"
        | "landscape-compact"
        | "landscape-content"

    固定尺寸档位;入口图标与列表缩略图这类不该被容器撑开的图必须声明,整数横图槽使用 landscape 档位。