Insert Image Button

lightning:insertImageButton

Button to insert an inline image in lightning:inputRichText. This component requires API version 43.0 and later. For Aura components only.

For Use In

Lightning Experience, Experience Builder Sites, Lightning Out (Beta), Standalone Lightning App

A lightning:insertImageButton component adds an image button to the toolbar of a rich text editor. The button is used to upload an image and insert it inline. The component can only be used as a child component within the lightning:inputRichText component.

Note: The image is visible to all org users by default. See Restricting Access to Uploaded Images in the lightning:inputRichText documentation.

Here’s an example that adds the image button to the rich text editor’s toolbar.

1<aura:component>
2  <lightning:inputRichText value="<b>HELLO</b>">
3    <lightning:insertImageButton />
4  </lightning:inputRichText>
5</aura:component>

Attributes 

NameDescriptionTypeDefaultRequired
bodyThe body of the component. In markup, this is everything in the body of the tag.Aura.Component[]
categoryThe button category for placement in the toolbar. Valid values are FORMAT_TEXT,FORMAT_BACKGROUND,FORMAT_BODY,ALIGN_TEXT,INSERT_CONTENT,REMOVE_FORMATTING,FORMAT_FONT. This value defaults to INSERT_CONTENT.StringINSERT_CONTENT