// Generated by scripts/generate-showcase.mjs. Do not edit directly. page DragAndDropDetail { layout = "showcase" state playground_size = ctx.url.searchParams.get("pg_size") ?? "default" state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary" state playground_title = ctx.url.searchParams.get("pg_title") ?? "Project priorities" state playground_description = ctx.url.searchParams.get("pg_description") ?? "Drag to reorder, or use the arrow buttons." state playground_items = JSON.parse(ctx.url.searchParams.get("pg_items") ?? "[{\"label\":\"Review designs\"},{\"label\":\"Build the dashboard\"},{\"label\":\"Test accessibility\"},{\"label\":\"Prepare release notes\"}]") state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "default" state playground_class = ctx.url.searchParams.get("pg_class") ?? "" seo { title = "Drag And Drop" description = "Theme-aware, responsive drag and drop component." } view {
Integrations component

Drag And Drop

Theme-aware, responsive drag and drop component.

7 props1 slots6 outputsTheme readyResponsive
Interactive playground

Configure Drag And Drop

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
page DragAndDropExample {
  state items = [
  {
    "label": "Review designs"
  },
  {
    "label": "Build the dashboard"
  },
  {
    "label": "Test accessibility"
  },
  {
    "label": "Prepare release notes"
  }
]
  view {
    <DragAndDrop
      title="Project priorities"
      description="Drag to reorder, or use the arrow buttons."
      items="{items}"
    />
  }
}
Event outputInteract with the preview to inspect the typed payload.
Component props7 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Production default

Balanced spacing, hierarchy, and content for the most common product workflow.

01
Live preview
Component usage.wrn
page DragAndDropExample {
  state items = [
  {
    "label": "Review designs"
  },
  {
    "label": "Build the dashboard"
  },
  {
    "label": "Test accessibility"
  },
  {
    "label": "Prepare release notes"
  }
]
  view {
    <DragAndDrop
      title="Project priorities"
      description="Drag to reorder, or use the arrow buttons."
      items="{items}"
    />
  }
}
Dense UI

Compact application

A tighter variation for dashboards, side panels, tables, and operational interfaces.

02
Live preview
Component usage.wrn
page DragAndDropExample {
  state items = [
  {
    "label": "Review designs"
  },
  {
    "label": "Build the dashboard"
  },
  {
    "label": "Test accessibility"
  },
  {
    "label": "Prepare release notes"
  }
]
  view {
    <DragAndDrop
      title="Project priorities"
      description="Drag to reorder, or use the arrow buttons."
      items="{items}"
    />
  }
}
Extended

Rich configuration

A more expressive variation using additional data, stronger emphasis, and optional states.

03
Live preview
Component usage.wrn
page DragAndDropExample {
  state items = [
  {
    "label": "Review designs"
  },
  {
    "label": "Build the dashboard"
  },
  {
    "label": "Test accessibility"
  },
  {
    "label": "Prepare release notes"
  }
]
  view {
    <DragAndDrop
      title="Project priorities"
      description="Drag to reorder, or use the arrow buttons."
      items="{items}"
    />
  }
}
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@dragStartFires when the component emits the dragStart event.
@dragEndFires when the component emits the dragEnd event.
@dragEnterFires when the component emits the dragEnter event.
@dragLeaveFires when the component emits the dragLeave event.
@dropFires when the component emits the drop event.
@changeFires when the component's committed value or selection changes.
Declarative handlers.wrn
<DragAndDrop
  @dragStart='console.log(payload)'
  @dragEnd='console.log(payload)'
  @dragEnter='console.log(payload)'
  @dragLeave='console.log(payload)'
  @drop='console.log(payload)'
  @change='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"DragAndDrop\"], [data-component=\"DragAndDrop\"]")

if (component) registerOutputHandler(component, "dragStart", (payload) => {
  console.log("dragStart", payload)
})

if (component) registerOutputHandler(component, "dragEnd", (payload) => {
  console.log("dragEnd", payload)
})

if (component) registerOutputHandler(component, "dragEnter", (payload) => {
  console.log("dragEnter", payload)
})

if (component) registerOutputHandler(component, "dragLeave", (payload) => {
  console.log("dragLeave", payload)
})

if (component) registerOutputHandler(component, "drop", (payload) => {
  console.log("drop", payload)
})

if (component) registerOutputHandler(component, "change", (payload) => {
  console.log("change", payload)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
sizestring"default"No
colorstring"primary"No
titlestring"Drag And Drop"No
descriptionstring""No
itemsunknown[][]No
variantstring"default"No
classstring""No
} }