跳到主要内容

get-illustration

<illustrations.get-illustration>provider

获取插画。

Examples

Playground

Usage in pro-code

import { unwrapProvider } from "@next-core/utils/general";
import type { getIllustration as _getIllustration } from "@next-bricks/illustrations/data-providers/get-illustration";

// Use `unwrapProvider` to get the original function of a provider
const getIllustration = unwrapProvider<typeof _getIllustration>(
"illustrations.get-illustration"
);

function MyComponent() {
const src = getIllustration({ category: "feedback", name: "fail" });
return <img src={src} />;
}

Definition

Parameters

#NameDescriptionType
1propsIllustrationProps

Returns

string | undefined

Type references

IllustrationProps

NameTypeRequiredDescription
namestring
categorystring
themeSiteTheme