Drop Indicator
- Stable
- WCAG 2.2 evidence
- RTL
Insertion line shown between two items while something is dragged over a GridList or ListBox. Render it from the renderDropIndicator
option of useDragAndDrop; SortableList and BoardColumn already do. Built on React Aria DropIndicator: the row carries data-drop-target while it is the active target and
data-insert-position (before, after, on or root) from its target. During a keyboard drag React Aria renders one
indicator per position with a visually hidden, labelled drop button ("Insert between A and B"), so screen reader and
keyboard users can choose the position (WCAG 2.1.1, 4.1.2); only the active target shows the line. The visual is
decorative (aria-hidden) and is drawn with borders so it survives forced colours.
import { DropIndicator } from "@nexera-ui/react";- 3
- examples
- 3
- props
- 0
- live controls
- 1
- platform
- 6
- WCAG criteria
- 0
- blocks use it
Try every prop. Copy the code.
Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.
import { DropIndicator } from "@nexera-ui/react";
<DropIndicator />Examples 2
The same examples as Storybook, rendered live. Open Code to copy one.
In sortable list
Drag a row (or press Enter on its handle and use the arrow keys) to see the indicator at each insertion point.
import { useState } from "react";
import { SortableItem, SortableList } from "@nexera-ui/react";
const steps = [
{ id: "offer", title: "Sign offer letter", meta: "Day 1 · HR" },
{ id: "laptop", title: "Collect laptop and badge", meta: "Day 1 · IT" },
{ id: "payroll", title: "Add bank details for payroll", meta: "Day 1 · Finance" },
{ id: "buddy", title: "Coffee with your onboarding buddy", meta: "Day 2 · Team" },
];
function ListDemo() {
const [items, setItems] = useState(steps);
return (
<SortableList
aria-label="Onboarding checklist"
items={items}
onReorder={setItems}
className="max-w-[27.5rem]"
>
{(step) => <SortableItem label={step.title} meta={step.meta} />}
</SortableList>
);
}
export function InSortableList() {
return <ListDemo />;
}
In kanban board
Drag a card within or across columns; Move to column in the card's menu does the same without dragging (WCAG 2.5.7).
import { useState } from "react";
import { Board, BoardCard, BoardColumn } from "@nexera-ui/react";
interface Card {
id: string;
name: string;
role: string;
}
const columns: BoardColumnData<Card>[] = [
{
id: "applied",
title: "Applied",
items: [
{ id: "zara", name: "Zara Siddiqui", role: "Frontend engineer" },
{ id: "omar", name: "Omar Farooq", role: "Data analyst" },
],
},
{
id: "interview",
title: "Interview",
items: [{ id: "hina", name: "Hina Baig", role: "Product designer" }],
},
];
function BoardDemo() {
const [value, setValue] = useState(columns);
return (
<Board columns={value} onColumnsChange={setValue}>
{value.map((column) => (
<section key={column.id} className="flex w-60 flex-col gap-2 rounded-lg bg-sunken p-2">
<h3 id={`drop-${column.id}`} className="m-0 px-1 text-heading-h4 text-primary">
{column.title}
</h3>
<BoardColumn<Card> columnId={column.id} aria-labelledby={`drop-${column.id}`}>
{(card) => <BoardCard name={card.name} subtitle={card.role} />}
</BoardColumn>
</section>
))}
</Board>
);
}
export function InKanbanBoard() {
return <BoardDemo />;
}
Props 3
3 props shown
classNameNexerastringExtra classes, merged last so they win over the defaults.
styleNexeraCSSPropertiesInline style.
target*React AriaDropTargetThe drop target that the drop indicator represents.
* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.
Accessible by default.
Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.
WCAG 2.2 evidence
5 direct · 1 supporting- 1.1.1Non-text ContentLevel A · tested directly
- 1.3.1Info and RelationshipsLevel A · tested directly
- 1.4.11Non-text ContrastLevel AA · supporting test
- 2.1.1KeyboardLevel A · tested directly
- 2.5.7Dragging MovementsLevel AA · tested directly
- 4.1.2Name, Role, ValueLevel A · tested directly
Fits any width.
Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.
Styling hooks
Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.
<DropIndicator className="shadow-sm" />Used in blocks
No block uses DropIndicator yet.
Related components
- BoardCardA Kanban card: avatar, name, role, drag handle and a detail line.
- ButtonTriggers an action such as Save, Submit, Approve or Delete.
- ButtonGroupItemOne toggle in a joined row of buttons, for example a List / Grid view switch or a set of filters.
- ContextMenuThe menu of actions for an element, opened where the user asks for it: right-click, long-press on touch screens, and from the keyboard with Shift+F10 or the ContextMenu key (the browser reports both as a `contextmenu` event on the focused element; on macOS, Control+Enter).
- DragHandleGrip that starts a drag of the collection item it sits in.
- IconButtonA square, icon-only button for compact actions such as Settings, Close or Delete row.
- MenuA list of actions or options that opens from a trigger.
- MenuDividerSeparates groups of items in a `Menu` or `ContextMenu`.