FlexiWidget
A widget is a component (such as a tile) that is stored within a target (dropzone). Widgets can be moved around within a target or between targets.
FlexiWidget (component)
Props
class stringThe class names to apply to this widget.
children Snippet<[{ widget: FlexiWidgetController, component?: Component, componentProps?: Record<string, any> }]>The content rendered within the widget.
draggable booleanWhether the widget is draggable.
resizability 'none' | 'horizontal' | 'vertical' | 'both'The resizability of the widget.
width numberThe width of the widget in units.
height numberThe height of the widget in units.
component Component<T>The component rendered within the widget.
componentProps TThe props applied to the component rendered, if it has one.
controller FlexiWidgetController (bindable)The controller for this widget.
onfirstcreate (controller: FlexiWidgetController) => voidA callback that fires when the widget's controller is first created.
FlexiWidgetController
FlexiWidgetController uses a controller to manage its state and behaviour. You can access the controller via binding to the controller prop or using the onfirstcreate callback.
The FlexiWidgetController allows you to access widget state directly.
Properties
target FlexiTargetController | undefinedThe target this widget is under. This is not defined if the widget has not yet been dropped in the board.
ref HTMLElement | undefinedThe DOM element bound to this widget.
config FlexiWidgetDerivedConfigurationThe reactive configuration of the widget.
isShadow booleanWhether this widget is a shadow dropzone widget.
isGrabbed booleanWhether this widget is grabbed.
isResizing booleanWhether this widget is being resized.
currentAction WidgetAction | nullThe current action being performed on the widget.
draggable booleanWhether the widget is draggable.
resizability 'none' | 'horizontal' | 'vertical' | 'both'The resizability of the widget.
width numberThe width of the widget in units.
height numberThe height of the widget in units.
component Component | undefinedThe component rendered within the widget.
componentProps Record<string, any> | undefinedThe props applied to the component rendered, if it has one.
snippet Snippet<[{ widget: FlexiWidgetController }]> | undefinedThe content rendered within the widget.
className ClassValue | undefinedThe class name that is applied to this widget.
x numberThe column (x-coordinate) of the widget.
y numberThe row (y-coordinate) of the widget.
grabTrigger FlexiWidgetTriggerConfigurationThe configuration for how pointer events should trigger a grab event on the widget. E.g. a long press.
resizeTrigger FlexiWidgetTriggerConfigurationThe configuration for how pointer events should trigger a resize event on the widget. E.g. a long press.
transitionConfig FlexiWidgetTransitionConfigurationGets the transition configuration for this widget.
hasGrabbers booleanWhether the widget has any grabbers attached.
hasResizers booleanWhether the widget has any resizers attached.
isBeingDropped booleanWhether the widget is currently being dropped after a drag operation.
metadata Record<string, any> | undefinedThe metadata associated with this widget, if any.
FlexiWidgetController does not expose any methods.
FlexiWidgetConfiguration
The configuration object for the FlexiWidget component. This is not reactive when invoked as props on the component, so to mutate it reactively you will need to mutate properties on the controller.
Properties
draggable booleanWhether the widget is draggable. Defaults to true. Reactive property.
resizability 'none' | 'horizontal' | 'vertical' | 'both'The resizability of the widget. Defaults to 'both'. Reactive property.
width numberThe width of the widget in units. Defaults to 1. Not reactive.
height numberThe height of the widget in units. Defaults to 1. Not reactive.
snippet SnippetThe snippet that is rendered by this widget. Reactive property.
component ComponentThe component that is rendered by this widget. Reactive property.
componentProps Record<string, any>The props applied to the component rendered, if it has one. Reactive property.
className ClassValueThe class names to apply to this widget. Reactive property.
x numberThe column (x-coordinate) of the widget. Not reactive.
y numberThe row (y-coordinate) of the widget. Not reactive.
metadata Record<string, any>The metadata associated with this widget, if any. Reactive property.
transition FlexiWidgetTransitionConfigurationThe transition configuration for this widget. Reactive property.
grabTrigger FlexiWidgetTriggerConfigurationThe configuration for how pointer events should trigger a grab event on the widget. E.g. a long press.
resizeTrigger FlexiWidgetTriggerConfigurationThe configuration for how pointer events should trigger a resize event on the widget. E.g. a long press.