Media Filecomponent
The component renders the media for the Storefront API's
Media object. It renders an
Image
, Video
, an , or a
depending on the
__typename
of the data
prop.
Anchor to propsProps
MediaFile renders an Image
, Video
, , or
component. Use the
prop to customize the props sent to each of these components.
- Anchor to datadataPartialDeep<MediaEdgeType['node'], {recurseIntoArrays: true}>required
An object with fields that correspond to the Storefront API's Media object.
- Anchor to aboutaboutstring | undefined
- Anchor to accessKeyaccessKeystring | undefined
- Anchor to aria-activedescendantaria-activedescendantstring | undefined
Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
- Anchor to aria-atomicaria-atomicBooleanish | undefined
Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
- Anchor to aria-autocompletearia-autocomplete'none' | 'inline' | 'list' | 'both' | undefined
Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
- Anchor to aria-braillelabelaria-braillelabelstring | undefined
Defines a string value that labels the current element, which is intended to be converted into Braille.
- Anchor to aria-brailleroledescriptionaria-brailleroledescriptionstring | undefined
Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
- Anchor to aria-busyaria-busyBooleanish | undefined
- Anchor to aria-checkedaria-checkedboolean | 'false' | 'mixed' | 'true' | undefined
Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
- Anchor to aria-colcountaria-colcountnumber | undefined
Defines the total number of columns in a table, grid, or treegrid.
- Anchor to aria-colindexaria-colindexnumber | undefined
Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
- Anchor to aria-colindextextaria-colindextextstring | undefined
Defines a human readable text alternative of aria-colindex.
- Anchor to aria-colspanaria-colspannumber | undefined
Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
- Anchor to aria-controlsaria-controlsstring | undefined
Identifies the element (or elements) whose contents or presence are controlled by the current element.
- Anchor to aria-currentaria-currentboolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time' | undefined
Indicates the element that represents the current item within a container or set of related elements.
- Anchor to aria-describedbyaria-describedbystring | undefined
Identifies the element (or elements) that describes the object.
- Anchor to aria-descriptionaria-descriptionstring | undefined
Defines a string value that describes or annotates the current element.
- Anchor to aria-detailsaria-detailsstring | undefined
Identifies the element that provides a detailed, extended description for the object.
- Anchor to aria-disabledaria-disabledBooleanish | undefined
Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
- Anchor to aria-errormessagearia-errormessagestring | undefined
Identifies the element that provides an error message for the object.
- Anchor to aria-expandedaria-expandedBooleanish | undefined
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
- Anchor to aria-flowtoaria-flowtostring | undefined
Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
- Anchor to aria-haspopuparia-haspopupboolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
- Booleanish | undefined
Indicates whether the element is exposed to an accessibility API.
- Anchor to aria-invalidaria-invalidboolean | 'false' | 'true' | 'grammar' | 'spelling' | undefined
Indicates the entered value does not conform to the format expected by the application.
- Anchor to aria-keyshortcutsaria-keyshortcutsstring | undefined
Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
- Anchor to aria-labelaria-labelstring | undefined
Defines a string value that labels the current element.
- Anchor to aria-labelledbyaria-labelledbystring | undefined
Identifies the element (or elements) that labels the current element.
- Anchor to aria-levelaria-levelnumber | undefined
Defines the hierarchical level of an element within a structure.
- Anchor to aria-livearia-live'off' | 'assertive' | 'polite' | undefined
Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
- Anchor to aria-modalaria-modalBooleanish | undefined
Indicates whether an element is modal when displayed.
- Anchor to aria-multilinearia-multilineBooleanish | undefined
Indicates whether a text box accepts multiple lines of input or only a single line.
- Anchor to aria-multiselectablearia-multiselectableBooleanish | undefined
Indicates that the user may select more than one item from the current selectable descendants.
- Anchor to aria-orientationaria-orientation'horizontal' | 'vertical' | undefined
Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
- Anchor to aria-ownsaria-ownsstring | undefined
Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
- Anchor to aria-placeholderaria-placeholderstring | undefined
Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
- Anchor to aria-posinsetaria-posinsetnumber | undefined
Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
- Anchor to aria-pressedaria-pressedboolean | 'false' | 'mixed' | 'true' | undefined
Indicates the current "pressed" state of toggle buttons.
- Anchor to aria-readonlyaria-readonlyBooleanish | undefined
Indicates that the element is not editable, but is otherwise operable.
- Anchor to aria-relevantaria-relevant'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals' | undefined
Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
- Anchor to aria-requiredaria-requiredBooleanish | undefined
Indicates that user input is required on the element before a form may be submitted.
- Anchor to aria-roledescriptionaria-roledescriptionstring | undefined
Defines a human-readable, author-localized description for the role of an element.
- Anchor to aria-rowcountaria-rowcountnumber | undefined
Defines the total number of rows in a table, grid, or treegrid.
- Anchor to aria-rowindexaria-rowindexnumber | undefined
Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
- Anchor to aria-rowindextextaria-rowindextextstring | undefined
Defines a human readable text alternative of aria-rowindex.
- Anchor to aria-rowspanaria-rowspannumber | undefined
Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
- Anchor to aria-selectedaria-selectedBooleanish | undefined
Indicates the current "selected" state of various widgets.
- Anchor to aria-setsizearia-setsizenumber | undefined
Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
- Anchor to aria-sortaria-sort'none' | 'ascending' | 'descending' | 'other' | undefined
Indicates if items in a table or grid are sorted in ascending or descending order.
- Anchor to aria-valuemaxaria-valuemaxnumber | undefined
Defines the maximum allowed value for a range widget.
- Anchor to aria-valueminaria-valueminnumber | undefined
Defines the minimum allowed value for a range widget.
- Anchor to aria-valuenowaria-valuenownumber | undefined
Defines the current value for a range widget.
- Anchor to aria-valuetextaria-valuetextstring | undefined
Defines the human readable text alternative of aria-valuenow for a range widget.
- Anchor to autoCapitalizeautoCapitalizestring | undefined
- Anchor to autoCorrectautoCorrectstring | undefined
- Anchor to autoFocusautoFocusboolean | undefined
- Anchor to autoSaveautoSavestring | undefined
- Anchor to childrenchildrenReactNode | undefined
- Anchor to classNameclassNamestring | undefined
- Anchor to colorcolorstring | undefined
- Anchor to contentcontentstring | undefined
- Anchor to contentEditablecontentEditableBooleanish | "inherit" | undefined
- string | undefined
- Anchor to dangerouslySetInnerHTMLdangerouslySetInnerHTML{ // Should be InnerHTML['innerHTML']. // But unfortunately we're mixing renderer-specific type declarations. __html: string | TrustedHTML; } | undefined
- Anchor to datatypedatatypestring | undefined
- Anchor to defaultCheckeddefaultCheckedboolean | undefined
- Anchor to defaultValuedefaultValuestring | number | ReadonlyArray<string> | undefined
- string | undefined
- Anchor to draggabledraggableBooleanish | undefined
- boolean | undefined
- string | undefined
- Anchor to inlistinlistany
- Anchor to inputModeinputMode'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' | undefined
Hints at the type of data that might be entered by the user while editing the element or its contents
- string | undefined
Specify that a standard HTML element should behave like a defined custom built-in element
- Anchor to itemIDitemIDstring | undefined
- Anchor to itemPropitemPropstring | undefined
- Anchor to itemRefitemRefstring | undefined
- Anchor to itemScopeitemScopeboolean | undefined
- Anchor to itemTypeitemTypestring | undefined
- Anchor to langlangstring | undefined
- Anchor to mediaOptionsmediaOptionsMediaOptions
The options for the
Image
,Video
,, or
components.
- Anchor to noncenoncestring | undefined
- Anchor to onAbortonAbortReactEventHandler<T> | undefined
- Anchor to onAbortCaptureonAbortCaptureReactEventHandler<T> | undefined
- Anchor to onAnimationEndonAnimationEndAnimationEventHandler<T> | undefined
- Anchor to onAnimationEndCaptureonAnimationEndCaptureAnimationEventHandler<T> | undefined
- Anchor to onAnimationIterationonAnimationIterationAnimationEventHandler<T> | undefined
- Anchor to onAnimationIterationCaptureonAnimationIterationCaptureAnimationEventHandler<T> | undefined
- Anchor to onAnimationStartonAnimationStartAnimationEventHandler<T> | undefined
- Anchor to onAnimationStartCaptureonAnimationStartCaptureAnimationEventHandler<T> | undefined
- Anchor to onAuxClickonAuxClickMouseEventHandler<T> | undefined
- Anchor to onAuxClickCaptureonAuxClickCaptureMouseEventHandler<T> | undefined
- Anchor to onBeforeInputonBeforeInputFormEventHandler<T> | undefined
- Anchor to onBeforeInputCaptureonBeforeInputCaptureFormEventHandler<T> | undefined
- Anchor to onBluronBlurFocusEventHandler<T> | undefined
- Anchor to onBlurCaptureonBlurCaptureFocusEventHandler<T> | undefined
- Anchor to onCanPlayonCanPlayReactEventHandler<T> | undefined
- Anchor to onCanPlayCaptureonCanPlayCaptureReactEventHandler<T> | undefined
- Anchor to onCanPlayThroughonCanPlayThroughReactEventHandler<T> | undefined
- Anchor to onCanPlayThroughCaptureonCanPlayThroughCaptureReactEventHandler<T> | undefined
- Anchor to onChangeonChangeFormEventHandler<T> | undefined
- Anchor to onChangeCaptureonChangeCaptureFormEventHandler<T> | undefined
- Anchor to onClickonClickMouseEventHandler<T> | undefined
- Anchor to onClickCaptureonClickCaptureMouseEventHandler<T> | undefined
- Anchor to onCompositionEndonCompositionEndCompositionEventHandler<T> | undefined
- Anchor to onCompositionEndCaptureonCompositionEndCaptureCompositionEventHandler<T> | undefined
- Anchor to onCompositionStartonCompositionStartCompositionEventHandler<T> | undefined
- Anchor to onCompositionStartCaptureonCompositionStartCaptureCompositionEventHandler<T> | undefined
- Anchor to onCompositionUpdateonCompositionUpdateCompositionEventHandler<T> | undefined
- Anchor to onCompositionUpdateCaptureonCompositionUpdateCaptureCompositionEventHandler<T> | undefined
- MouseEventHandler<T> | undefined
- MouseEventHandler<T> | undefined
- Anchor to onCopyonCopyClipboardEventHandler<T> | undefined
- Anchor to onCopyCaptureonCopyCaptureClipboardEventHandler<T> | undefined
- Anchor to onCutonCutClipboardEventHandler<T> | undefined
- Anchor to onCutCaptureonCutCaptureClipboardEventHandler<T> | undefined
- Anchor to onDoubleClickonDoubleClickMouseEventHandler<T> | undefined
- Anchor to onDoubleClickCaptureonDoubleClickCaptureMouseEventHandler<T> | undefined
- Anchor to onDragonDragDragEventHandler<T> | undefined
- Anchor to onDragCaptureonDragCaptureDragEventHandler<T> | undefined
- Anchor to onDragEndonDragEndDragEventHandler<T> | undefined
- Anchor to onDragEndCaptureonDragEndCaptureDragEventHandler<T> | undefined
- Anchor to onDragEnteronDragEnterDragEventHandler<T> | undefined
- Anchor to onDragEnterCaptureonDragEnterCaptureDragEventHandler<T> | undefined
- Anchor to onDragExitonDragExitDragEventHandler<T> | undefined
- Anchor to onDragExitCaptureonDragExitCaptureDragEventHandler<T> | undefined
- Anchor to onDragLeaveonDragLeaveDragEventHandler<T> | undefined
- Anchor to onDragLeaveCaptureonDragLeaveCaptureDragEventHandler<T> | undefined
- Anchor to onDragOveronDragOverDragEventHandler<T> | undefined
- Anchor to onDragOverCaptureonDragOverCaptureDragEventHandler<T> | undefined
- Anchor to onDragStartonDragStartDragEventHandler<T> | undefined
- Anchor to onDragStartCaptureonDragStartCaptureDragEventHandler<T> | undefined
- Anchor to onDroponDropDragEventHandler<T> | undefined
- Anchor to onDropCaptureonDropCaptureDragEventHandler<T> | undefined
- Anchor to onDurationChangeonDurationChangeReactEventHandler<T> | undefined
- Anchor to onDurationChangeCaptureonDurationChangeCaptureReactEventHandler<T> | undefined
- Anchor to onEmptiedonEmptiedReactEventHandler<T> | undefined
- Anchor to onEmptiedCaptureonEmptiedCaptureReactEventHandler<T> | undefined
- Anchor to onEncryptedonEncryptedReactEventHandler<T> | undefined
- Anchor to onEncryptedCaptureonEncryptedCaptureReactEventHandler<T> | undefined
- Anchor to onEndedonEndedReactEventHandler<T> | undefined
- Anchor to onEndedCaptureonEndedCaptureReactEventHandler<T> | undefined
- Anchor to onErroronErrorReactEventHandler<T> | undefined
- Anchor to onErrorCaptureonErrorCaptureReactEventHandler<T> | undefined
- Anchor to onFocusonFocusFocusEventHandler<T> | undefined
- Anchor to onFocusCaptureonFocusCaptureFocusEventHandler<T> | undefined
- Anchor to onGotPointerCaptureonGotPointerCapturePointerEventHandler<T> | undefined
- Anchor to onGotPointerCaptureCaptureonGotPointerCaptureCapturePointerEventHandler<T> | undefined
- Anchor to onInputonInputFormEventHandler<T> | undefined
- Anchor to onInputCaptureonInputCaptureFormEventHandler<T> | undefined
- Anchor to onInvalidonInvalidFormEventHandler<T> | undefined
- Anchor to onInvalidCaptureonInvalidCaptureFormEventHandler<T> | undefined
- Anchor to onKeyDownonKeyDownKeyboardEventHandler<T> | undefined
- Anchor to onKeyDownCaptureonKeyDownCaptureKeyboardEventHandler<T> | undefined
- Anchor to onKeyUponKeyUpKeyboardEventHandler<T> | undefined
- Anchor to onKeyUpCaptureonKeyUpCaptureKeyboardEventHandler<T> | undefined
- Anchor to onLoadonLoadReactEventHandler<T> | undefined
- Anchor to onLoadCaptureonLoadCaptureReactEventHandler<T> | undefined
- Anchor to onLoadedDataonLoadedDataReactEventHandler<T> | undefined
- Anchor to onLoadedDataCaptureonLoadedDataCaptureReactEventHandler<T> | undefined
- Anchor to onLoadedMetadataonLoadedMetadataReactEventHandler<T> | undefined
- Anchor to onLoadedMetadataCaptureonLoadedMetadataCaptureReactEventHandler<T> | undefined
- Anchor to onLoadStartonLoadStartReactEventHandler<T> | undefined
- Anchor to onLoadStartCaptureonLoadStartCaptureReactEventHandler<T> | undefined
- Anchor to onLostPointerCaptureonLostPointerCapturePointerEventHandler<T> | undefined
- Anchor to onLostPointerCaptureCaptureonLostPointerCaptureCapturePointerEventHandler<T> | undefined
- Anchor to onMouseDownonMouseDownMouseEventHandler<T> | undefined
- Anchor to onMouseDownCaptureonMouseDownCaptureMouseEventHandler<T> | undefined
- Anchor to onMouseEnteronMouseEnterMouseEventHandler<T> | undefined
- Anchor to onMouseLeaveonMouseLeaveMouseEventHandler<T> | undefined
- Anchor to onMouseMoveonMouseMoveMouseEventHandler<T> | undefined
- Anchor to onMouseMoveCaptureonMouseMoveCaptureMouseEventHandler<T> | undefined
- Anchor to onMouseOutonMouseOutMouseEventHandler<T> | undefined
- Anchor to onMouseOutCaptureonMouseOutCaptureMouseEventHandler<T> | undefined
- Anchor to onMouseOveronMouseOverMouseEventHandler<T> | undefined
- Anchor to onMouseOverCaptureonMouseOverCaptureMouseEventHandler<T> | undefined
- Anchor to onMouseUponMouseUpMouseEventHandler<T> | undefined
- Anchor to onMouseUpCaptureonMouseUpCaptureMouseEventHandler<T> | undefined
- Anchor to onPasteonPasteClipboardEventHandler<T> | undefined
- Anchor to onPasteCaptureonPasteCaptureClipboardEventHandler<T> | undefined
- Anchor to onPauseonPauseReactEventHandler<T> | undefined
- Anchor to onPauseCaptureonPauseCaptureReactEventHandler<T> | undefined
- Anchor to onPlayonPlayReactEventHandler<T> | undefined
- Anchor to onPlayCaptureonPlayCaptureReactEventHandler<T> | undefined
- Anchor to onPlayingonPlayingReactEventHandler<T> | undefined
- Anchor to onPlayingCaptureonPlayingCaptureReactEventHandler<T> | undefined
- Anchor to onPointerCancelonPointerCancelPointerEventHandler<T> | undefined
- Anchor to onPointerCancelCaptureonPointerCancelCapturePointerEventHandler<T> | undefined
- Anchor to onPointerDownonPointerDownPointerEventHandler<T> | undefined
- Anchor to onPointerDownCaptureonPointerDownCapturePointerEventHandler<T> | undefined
- Anchor to onPointerEnteronPointerEnterPointerEventHandler<T> | undefined
- Anchor to onPointerEnterCaptureonPointerEnterCapturePointerEventHandler<T> | undefined
- Anchor to onPointerLeaveonPointerLeavePointerEventHandler<T> | undefined
- Anchor to onPointerLeaveCaptureonPointerLeaveCapturePointerEventHandler<T> | undefined
- Anchor to onPointerMoveonPointerMovePointerEventHandler<T> | undefined
- Anchor to onPointerMoveCaptureonPointerMoveCapturePointerEventHandler<T> | undefined
- Anchor to onPointerOutonPointerOutPointerEventHandler<T> | undefined
- Anchor to onPointerOutCaptureonPointerOutCapturePointerEventHandler<T> | undefined
- Anchor to onPointerOveronPointerOverPointerEventHandler<T> | undefined
- Anchor to onPointerOverCaptureonPointerOverCapturePointerEventHandler<T> | undefined
- Anchor to onPointerUponPointerUpPointerEventHandler<T> | undefined
- Anchor to onPointerUpCaptureonPointerUpCapturePointerEventHandler<T> | undefined
- Anchor to onProgressonProgressReactEventHandler<T> | undefined
- Anchor to onProgressCaptureonProgressCaptureReactEventHandler<T> | undefined
- Anchor to onRateChangeonRateChangeReactEventHandler<T> | undefined
- Anchor to onRateChangeCaptureonRateChangeCaptureReactEventHandler<T> | undefined
- Anchor to onResetonResetFormEventHandler<T> | undefined
- Anchor to onResetCaptureonResetCaptureFormEventHandler<T> | undefined
- Anchor to onResizeonResizeReactEventHandler<T> | undefined
- Anchor to onResizeCaptureonResizeCaptureReactEventHandler<T> | undefined
- Anchor to onScrollonScrollUIEventHandler<T> | undefined
- Anchor to onScrollCaptureonScrollCaptureUIEventHandler<T> | undefined
- Anchor to onSeekedonSeekedReactEventHandler<T> | undefined
- Anchor to onSeekedCaptureonSeekedCaptureReactEventHandler<T> | undefined
- Anchor to onSeekingonSeekingReactEventHandler<T> | undefined
- Anchor to onSeekingCaptureonSeekingCaptureReactEventHandler<T> | undefined
- Anchor to onSelectonSelectReactEventHandler<T> | undefined
- Anchor to onSelectCaptureonSelectCaptureReactEventHandler<T> | undefined
- Anchor to onStalledonStalledReactEventHandler<T> | undefined
- Anchor to onStalledCaptureonStalledCaptureReactEventHandler<T> | undefined
- Anchor to onSubmitonSubmitFormEventHandler<T> | undefined
- Anchor to onSubmitCaptureonSubmitCaptureFormEventHandler<T> | undefined
- Anchor to onSuspendonSuspendReactEventHandler<T> | undefined
- Anchor to onSuspendCaptureonSuspendCaptureReactEventHandler<T> | undefined
- Anchor to onTimeUpdateonTimeUpdateReactEventHandler<T> | undefined
- Anchor to onTimeUpdateCaptureonTimeUpdateCaptureReactEventHandler<T> | undefined
- Anchor to onTouchCancelonTouchCancelTouchEventHandler<T> | undefined
- Anchor to onTouchCancelCaptureonTouchCancelCaptureTouchEventHandler<T> | undefined
- Anchor to onTouchEndonTouchEndTouchEventHandler<T> | undefined
- Anchor to onTouchEndCaptureonTouchEndCaptureTouchEventHandler<T> | undefined
- Anchor to onTouchMoveonTouchMoveTouchEventHandler<T> | undefined
- Anchor to onTouchMoveCaptureonTouchMoveCaptureTouchEventHandler<T> | undefined
- Anchor to onTouchStartonTouchStartTouchEventHandler<T> | undefined
- Anchor to onTouchStartCaptureonTouchStartCaptureTouchEventHandler<T> | undefined
- Anchor to onTransitionEndonTransitionEndTransitionEventHandler<T> | undefined
- Anchor to onTransitionEndCaptureonTransitionEndCaptureTransitionEventHandler<T> | undefined
- Anchor to onVolumeChangeonVolumeChangeReactEventHandler<T> | undefined
- Anchor to onVolumeChangeCaptureonVolumeChangeCaptureReactEventHandler<T> | undefined
- Anchor to onWaitingonWaitingReactEventHandler<T> | undefined
- Anchor to onWaitingCaptureonWaitingCaptureReactEventHandler<T> | undefined
- Anchor to onWheelonWheelWheelEventHandler<T> | undefined
- Anchor to onWheelCaptureonWheelCaptureWheelEventHandler<T> | undefined
- Anchor to placeholderplaceholderstring | undefined
- Anchor to prefixprefixstring | undefined
- Anchor to propertypropertystring | undefined
- Anchor to radioGroupradioGroupstring | undefined
- string | undefined
- Anchor to resourceresourcestring | undefined
- Anchor to resultsresultsnumber | undefined
- string | undefined
- Anchor to roleroleAriaRole | undefined
- Anchor to securitysecuritystring | undefined
- Anchor to slotslotstring | undefined
- Anchor to spellCheckspellCheckBooleanish | undefined
- Anchor to stylestyleCSSProperties | undefined
- Anchor to suppressContentEditableWarningsuppressContentEditableWarningboolean | undefined
- Anchor to suppressHydrationWarningsuppressHydrationWarningboolean | undefined
- Anchor to tabIndextabIndexnumber | undefined
- Anchor to titletitlestring | undefined
- Anchor to translatetranslate'yes' | 'no' | undefined
- Anchor to typeoftypeofstring | undefined
- Anchor to unselectableunselectable'on' | 'off' | undefined
- Anchor to vocabvocabstring | undefined
- Anchor to aria-dropeffectaria-dropeffect'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup' | undefineddeprecated
Indicates what functions can be performed when a dragged object is released on the drop target.
Deprecatedin ARIA 1.1
- Anchor to aria-grabbedaria-grabbedBooleanish | undefineddeprecated
Indicates an element's "grabbed" state in a drag-and-drop operation.
Deprecatedin ARIA 1.1
- Anchor to onKeyPressonKeyPressKeyboardEventHandler<T> | undefineddeprecated
- Deprecated
Deprecated
- Anchor to onKeyPressCaptureonKeyPressCaptureKeyboardEventHandler<T> | undefineddeprecated
- Deprecated
Deprecated
MediaOptions
- externalVideo
Props that will only apply when an `<ExternalVideo />` is rendered
Omit< React.ComponentProps<typeof ExternalVideo>['options'], 'data' >
- image
Props that will only apply when an `<Image />` is rendered
Omit<HydrogenImageProps, 'data'>
- modelViewer
Props that will only apply when a `<ModelViewer />` is rendered
Omit<typeof ModelViewer, 'data'>
- video
Props that will only apply when a `<Video />` is rendered
Omit<React.ComponentProps<typeof Video>, 'data'>
{
/** Props that will only apply when an `<Image />` is rendered */
image?: Omit<HydrogenImageProps, 'data'>;
/** Props that will only apply when a `<Video />` is rendered */
video?: Omit<React.ComponentProps<typeof Video>, 'data'>;
/** Props that will only apply when an `<ExternalVideo />` is rendered */
externalVideo?: Omit<
React.ComponentProps<typeof ExternalVideo>['options'],
'data'
>;
/** Props that will only apply when a `<ModelViewer />` is rendered */
modelViewer?: Omit<typeof ModelViewer, 'data'>;
}
HydrogenImageProps
React.ComponentPropsWithRef<'img'> & HydrogenImageBaseProps
HydrogenImageBaseProps
- aspectRatio
The aspect ratio of the image, in the format of `width/height`.
string
- crop
The crop position of the image.
Crop
- data
Data mapping to the [Storefront API `Image`](https://shopify.dev/docs/api/storefront/2025-04/objects/Image) object. Must be an Image object.
PartialDeep<ImageType, {recurseIntoArrays: true}>
- loader
A function that returns a URL string for an image.
Loader
- srcSetOptions
An optional prop you can use to change the default srcSet generation behaviour
SrcSetOptions
{
/** The aspect ratio of the image, in the format of `width/height`.
*
* @example
* ```
* <Image data={productImage} aspectRatio="4/5" />
* ```
*/
aspectRatio?: string;
/** The crop position of the image.
*
* @remarks
* In the event that AspectRatio is set, without specifying a crop,
* the Shopify CDN won't return the expected image.
*
* @defaultValue `center`
*/
crop?: Crop;
/** Data mapping to the [Storefront API `Image`](https://shopify.dev/docs/api/storefront/2025-04/objects/Image) object. Must be an Image object.
*
* @example
* ```
* import {IMAGE_FRAGMENT, Image} from '@shopify/hydrogen';
*
* export const IMAGE_QUERY = `#graphql
* ${IMAGE_FRAGMENT}
* query {
* product {
* featuredImage {
* ...Image
* }
* }
* }`
*
* <Image
* data={productImage}
* sizes="(min-width: 45em) 50vw, 100vw"
* aspectRatio="4/5"
* />
* ```
*
* Image: {@link https://shopify.dev/api/storefront/reference/common-objects/image}
*/
data?: PartialDeep<ImageType, {recurseIntoArrays: true}>;
/** A function that returns a URL string for an image.
*
* @remarks
* By default, this uses Shopify’s CDN {@link https://cdn.shopify.com/} but you can provide
* your own function to use a another provider, as long as they support URL based image transformations.
*/
loader?: Loader;
/** An optional prop you can use to change the default srcSet generation behaviour */
srcSetOptions?: SrcSetOptions;
}
Crop
'center' | 'top' | 'bottom' | 'left' | 'right'
Loader
- params
LoaderParams
string
export type Loader = (params: LoaderParams) => string;
LoaderParams
- crop
The URL param that controls the cropping region
Crop
- height
The URL param that controls height
number
- src
The base URL of the image
string
- width
The URL param that controls width
number
{
/** The base URL of the image */
src?: ImageType['url'];
/** The URL param that controls width */
width?: number;
/** The URL param that controls height */
height?: number;
/** The URL param that controls the cropping region */
crop?: Crop;
}
SrcSetOptions
- incrementSize
The increment by which to increase for each size, in pixels
number
- intervals
The number of sizes to generate
number
- placeholderWidth
The size used for placeholder fallback images
number
- startingWidth
The smallest image size
number
{
/** The number of sizes to generate */
intervals: number;
/** The smallest image size */
startingWidth: number;
/** The increment by which to increase for each size, in pixels */
incrementSize: number;
/** The size used for placeholder fallback images */
placeholderWidth: number;
}
Example code
Examples
Example code
Description
I am the default example
JavaScript
import {MediaFile} from '@shopify/hydrogen'; export function ProductsMediaFiles({products}) { return ( <ul> {products.nodes.map((product) => { return <MediaFile data={product.media.nodes[0]} key={product.id} />; })} </ul> ); }
TypeScript
import {MediaFile} from '@shopify/hydrogen'; import type {ProductConnection} from '@shopify/hydrogen/storefront-api-types'; export function ProductsMediaFiles({products}: {products: ProductConnection}) { return ( <ul> {products.nodes.map((product) => { return <MediaFile data={product.media.nodes[0]} key={product.id} />; })} </ul> ); }