Skip to main content
Version: v2.0.0

ImageComponent

Defined in: parser/types.ts:647

The ImageComponent interface is used to define the properties of an image component. This component is used to render an image with optional styling.

For example, to render an image with a path of path/to/study/assets/image.jpg and a max width of 50%, you would use the following snippet:

{
"type": "image",
"path": "<study-name>/assets/image.jpg",
"style": {
"maxWidth": "50%"
}
}

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
allowFailedTraining?booleanControls whether the component should allow failed training. If not provided, the default is true.BaseIndividualComponent.allowFailedTrainingparser/types.ts:548
correctAnswer?Answer[]The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.BaseIndividualComponent.correctAnswerparser/types.ts:542
description?stringThe description of the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.descriptionparser/types.ts:552
instruction?stringThe instruction of the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.instructionparser/types.ts:554
instructionLocation?"sidebar" | "aboveStimulus" | "belowStimulus"The location of the instructions.BaseIndividualComponent.instructionLocationparser/types.ts:540
meta?Record<string, unknown>The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.metaparser/types.ts:550
nextButtonDisableTime?numberA timeout (in ms) after which the next button will be disabled.BaseIndividualComponent.nextButtonDisableTimeparser/types.ts:558
nextButtonEnableTime?numberA timer (in ms) after which the next button will be enabled.BaseIndividualComponent.nextButtonEnableTimeparser/types.ts:560
nextButtonLocation?"sidebar" | "aboveStimulus" | "belowStimulus"The location of the next button.BaseIndividualComponent.nextButtonLocationparser/types.ts:538
nextButtonText?stringThe text that is displayed on the next button.BaseIndividualComponent.nextButtonTextparser/types.ts:536
pathstringThe path to the image. This should be a relative path from the public folder.-parser/types.ts:650
provideFeedback?booleanControls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.BaseIndividualComponent.provideFeedbackparser/types.ts:544
recordAudio?booleanWhether or not to record audio for a component. Only relevant if recordStudyAudio in the uiConfig is true. Defaults to false.BaseIndividualComponent.recordAudioparser/types.ts:556
responseResponse[]The responses to the componentBaseIndividualComponent.responseparser/types.ts:532
responseDividers?booleanWhether to show the response dividers. Defaults to false.BaseIndividualComponent.responseDividersparser/types.ts:562
style?Record<string, string>The style of the image. This is an object with css properties as keys and css values as values.-parser/types.ts:652
trainingAttempts?numberThe number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.BaseIndividualComponent.trainingAttemptsparser/types.ts:546
type"image"--parser/types.ts:648