An image component in react.
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props | object | Component props. Properties
| |||||||||||||||||||||||||||||||||||||||||||||
ref | object | | Ref to the component. |
- Since
- 1.1.15
- Source
Return the function image component in React.
- Type:
- JSX.
Element
import Image from '@gravityforms/components/react/admin/elements/Image';
return (
<Image
asBg={ true }
aspectRatio={ 1.5 }
url="https://path.to.image/"
/>
);
Methods
(inner) getBackgroundImage(props) → {JSX.Element}
Get the markup in react for a background image.
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
props | object | Props for the background image. Properties
|
- Since
- 1.1.15
- Source
The background image.
- Type:
- JSX.
Element
(inner) getBackgroundPosition(position) → {string}
Get the background position for the background image.
Name | Type | Description |
---|---|---|
position | string | The background image position. |
- Source
The position of the background image.
- Type:
- string
(inner) getImageCaption(props) → {JSX.Element}
Get the markup in react for a caption for the image component.
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props | object | Props for the caption. Properties
|
- Since
- 1.1.15
- Source
The caption for the image component.
- Type:
- JSX.
Element
(inner) getImageWithCaption(props) → {JSX.Element}
Get the markup in react for an image with caption.
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props | object | Props for the image with caption. Properties
|
- Since
- 1.1.15
- Source
The image with caption.
- Type:
- JSX.
Element