# BdndDraggable (Component) `Bit.Bdnd.BdndDraggable`1` - inherits `ComponentBase` - implements `IAsyncDisposable`, `IComponent`, `IHandleAfterRender`, `IHandleEvent` Wires its host element into the DnD system as a drag source. This is the component equivalent of React DnD's useDrag hook: you declare a BdndDraggable.Type and an BdndDraggable.Item (the data), and the child content receives a BdndDragState with the collected props (e.g. IsDragging). ## Parameter - **AdditionalAttributes** : `IReadOnlyDictionary` - Any other attribute (class, style, id...), applied to the host element. - **AllowKeyboard** : `bool` = `true` - Whether the keyboard can drag the source: Space or Enter on it (or on its BdndDragHandle) picks it up, the arrow keys move it between the drop targets that can take it, Space or Enter drops it and Escape cancels. Defaults to true, which makes the source (or its handle) focusable while it can drag. A host that is interactive by itself (BdndDraggable.Taga, button, input, select, textarea, summary) keeps its own keys: give it a BdndDragHandle to drag it with the keyboard. BdndProvider.AllowKeyboard turns keyboard dragging off for a whole provider. - **AutoScroll** : `bool` = `true` - Whether a pointer drag scrolls the scroll container (or the page) under the pointer while the pointer is near its edge. Native drags scroll as the browser does. Defaults to true. - **CanDrag** : `bool` = `true` - Whether dragging is allowed. Defaults to true. - **CanDragPredicate** : `Func` - Optional predicate overriding BdndDraggable.CanDrag, evaluated at render time and at drag start. - **ChildContent** : `RenderFragment` - The draggable's content; it receives the collected BdndDragState. - **DragThreshold** : `double` = `5` - How far, in CSS pixels, a pointer has to move with the button down before a pointer drag starts, so that a click is not taken for a drag. Defaults to 5. - **DropEffect** : `string` = `"move"` - The drop effects the source allows, assigned to the native dataTransfer.effectAllowed (drives the cursor): move (default), copy, link, copyMove, copyLink, linkMove or all. - **IsDraggingOverride** : `Func` - Custom isDragging implementation (e.g. id-based for re-parented items). - **Item** : `TItem` - The item payload. Ignored when BdndDraggable.ItemFactory is supplied. - **ItemFactory** : `Func` - Produces the item lazily at drag start. Return null to cancel the drag (use a nullable TItem for value types, where default is a valid item). - **Label** : `string` - The source's name for screen readers, read out as a keyboard drag picks it up, moves and drops it ("Picked up Write the docs"); a BdndDragHandle without an aria-label of its own is labelled with it too. Without it the source's aria-label or text is read. - **NativeData** : `IReadOnlyDictionary` - Data a native drag of the source carries for destinations outside the page, by DataTransfer type - say text/plain for a text field or another application, text/uri-list for a browser tab, or a type of your own for another window of your app. It is set at dragstart; pointer and keyboard drags never leave the page and carry none. Drop targets of this page still treat the drag as the in-app drag it is. - **OnBegin** : `EventCallback` - Fired when the drag begins, right after the browser started the drag and before any hover, drop or end callback of that drag. - **OnEnd** : `EventCallback>` - Fired when the drag ends (drop or cancel), even if this component was removed meanwhile. - **PointerDrag** : `BdndPointerDrag` = `BdndPointerDrag.Touch` - Which pointers drag the source through Bdnd's pointer-driven drag instead of the browser's native drag and drop: BdndPointerDrag.Touch (the default) for touch and pen, which most touch browsers never turn into native drags; BdndPointerDrag.All for the mouse too; BdndPointerDrag.None for the native drag and drop alone. A pointer drag shows a copy of the source following the pointer (unless BdndDraggable.UseCustomDragLayer is set, when a BdndDragLayer draws the preview), and scrolls the containers it nears the edge of (BdndDraggable.AutoScroll). - **PreviewAxis** : `BdndAxis` = `BdndAxis.None` - Keeps the copy that follows the pointer in a pointer drag on one axis: BdndAxis.Vertical moves it only up and down (a vertical list), BdndAxis.Horizontal only sideways. Where the drop lands is still decided by the pointer. A native mouse drag shows the browser's image, which no page can hold to an axis; a BdndDragLayer keeps its own preview with SourceClientOffsetOn. Defaults to BdndAxis.None. - **Tag** : `string` = `"div"` - Host element tag name. Defaults to div. - **TouchDelay** : `int` = `250` - How long, in milliseconds, a touch (or pen) has to rest on the source before a pointer drag starts, so that a swipe across it still scrolls the page; moving more than BdndDraggable.DragThreshold before then gives the press up. A BdndDragHandle starts at once, without the delay: it does not scroll (touch-action: none). Defaults to 250. - **Type** : `string` **(required)** - Required. The item type used to match against drop-target Accept lists. - **UseCustomDragLayer** : `bool` = `false` - Hide the native drag image (use together with a BdndDragLayer). - **UseHandle** : `bool` = `false` - Require a BdndDragHandle child to initiate the drag. ## Method - **DisposeAsync**() : `ValueTask`