Skip to content

BaseDropBox

An Element to drop files or other UI Elements into

Props

Prop nameDescriptionTypeValuesDefault
iconspecify an icon to be displayed centered in the boxstring-null
showPlusif true a plus sign is displayed in front of the iconboolean-false
textthe text displayed below the iconstring-''
subtextspecify a potential subtextstring-''
boxSizedefine the box sizeobject-{
width: '250px'
}
boxRatiodefine the ratio of width and height of the box
(in percent string, e.g. 1:1 --> '100', 1:2 --> '50')
string-'100'
renderElementAsspecify the tag of the buttonstring-'div'
dropTypespecify the type of dropsstringfiles, elements'files'
dropElementNameif the dropType is elements, specify the element group name
this needs to match the group name of the draggable element that should
be dragged into this element
string-''
dragItemClassif the dropType is elements specify a class name to limit interactions to a certain elementstring-''
disabledset button inactiveboolean-false
showTooltipshow tooltipboolean-false

Events

Event namePropertiesDescription
clickedundefined Event - propagating the triggered click eventTriggered when the box or tooltip is clicked
dropped-elementundefined string - the id of the dropped elementevent emitted when an element is dropped on the box, emitting the element data id
dropped-fileundefined DragEvent - propagating the triggered eventevent emitted when a file or an element is dropped on the box, emitting the type of event

Demo

A box with event firing on drop