-
Notifications
You must be signed in to change notification settings - Fork 282
/
Image.doc.ts
45 lines (43 loc) · 1.52 KB
/
Image.doc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
const data: ReferenceEntityTemplateSchema = {
name: 'Image',
category: 'components',
subCategory: 'media',
isVisualComponent: false,
related: [
{
name: 'MediaFile',
type: 'component',
url: '/api/hydrogen-react/components/mediafile',
},
],
description:
"The `Image` component renders an image for the Storefront API's\n[Image object](https://shopify.dev/api/storefront/reference/common-objects/image) by using the `data` prop. You can [customize this component](https://shopify.dev/api/hydrogen/components#customizing-hydrogen-components) using passthrough props.\n\nImages default to being responsive automatically (`width: 100%, height: auto`), and expect an `aspectRatio` prop, which ensures your image doesn't create any layout shift. For fixed-size images, you can set `width` to an exact value, and a `srcSet` with 1x, 2x, and 3x DPI variants will automatically be generated for you.",
type: 'component',
defaultExample: {
description: 'I am the default example',
codeblock: {
tabs: [
{
title: 'JavaScript',
code: './Image.example.jsx',
language: 'jsx',
},
{
title: 'TypeScript',
code: './Image.example.tsx',
language: 'tsx',
},
],
title: 'Example code',
},
},
definitions: [
{
title: 'Props',
type: 'HydrogenImageBaseProps',
description: '',
},
],
};
export default data;