Heads up! These docs are still a work in progress.

FlexiBoard

The main container component of a board, managing the targets and widgets within it.

FlexiBoard (component)

Props

NameTypeDescription
configFlexiBoardConfigurationThe configuration object for the board.
classSvelteClassValueThe class to apply to the board.
childrenSnippetThe child content of the board, which should contain the inner FlexiTarget and FlexiWidget components.
controllerFlexiBoardController (bindable)The controller for the board.
onfirstcreate(controller: FlexiBoardController) => voidA callback that fires when the board's controller is first created.

FlexiBoardController

FlexiBoard 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 FlexiBoardController allows you to manage the board directly and carry out actions.

Properties

NameTypeDescription
stylestringThe reactive styling to apply to the board's root element.
refHTMLElement | nullThe reactive DOM reference to the board's root element.

Methods

NameTypeDescription
moveWidget(widget: FlexiWidgetController, from: FlexiTargetController | undefined, to: FlexiTargetController) => voidMoves an existing widget from one target to another.

FlexiBoardConfiguration

The configuration object for the FlexiBoard component, which supports reactivity where specified.

To use reactivity, ensure that the config prop has a reactive source (proxy).

Properties

NameTypeDescription
widgetDefaultsFlexiWidgetDefaultsThe default configuration for widgets. Reactive.
targetDefaultsFlexiTargetDefaultsThe default configuration for targets. Reactive.

FlexiTargetDefaults

The default configuration for targets.

Properties

NameTypeDescription
rowSizingstring | ({ target, grid }: { target: FlexiTargetController, grid: FlexiGrid }) => stringAllows the specifying of the value inside the `repeat()` function of the `grid-template-rows` CSS property for the target. Defaults to 'minmax(1rem, auto)'. Reactive.
columnSizingstring | ({ target, grid }: { target: FlexiTargetController, grid: FlexiGrid }) => stringAllows the specifying of the value inside the `repeat()` function of the `grid-template-columns` CSS property for the target. Defaults to 'minmax(0, 1fr)'. Reactive.
baseColumnsnumberThe base number of columns for the target's grid. Defaults to 1. Not reactive.
baseRowsnumberThe base number of rows for the target's grid. Defaults to 1. Not reactive.
layoutTargetLayoutThe layout algorithm and parameters to use for the target grid. Reactive.

FlexiWidgetDefaults

The default configuration for widgets.

Properties

NameTypeDescription
draggablebooleanWhether the widget is draggable. Defaults to true. Reactive.
resizability'none' | 'horizontal' | 'vertical' | 'both'The resizability of the widget. Defaults to 'both'. Reactive.
widthnumberThe width of the widget in units. Defaults to 1. Not reactive.
heightnumberThe height of the widget in units. Defaults to 1. Not reactive.
snippetSnippetThe snippet that is rendered by this widget. Reactive.
componentComponentThe component that is rendered by this widget. Reactive.
componentPropsRecord<string, any>The props applied to the component rendered, if it has one. Reactive.
classNameClassValueThe class names to apply to this widget. Reactive.