XiodUI
HomeDocs
OverviewComponentsStyling & CustomizationChangelog

Components

  • Accordion
  • Agent Steps
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Autocomplete
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • Button Group
  • Button Split
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Circular Progress
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy To Clipboard
  • Corner Badge
  • Dashboard Grid
  • Date Picker
  • Dialog
  • Dot Matrix
  • Draggable
    Updated
  • Drawer
  • Empty
  • Field
  • Fieldset
  • File Upload
    Updated
  • Form
  • Frame
  • Gauge
  • Grid
  • Group
  • Input
  • Input Group
  • Input OTP
  • Input Payment
  • Input Phone
    Updated
  • Input Sensitive
  • Kbd
  • Kinetic Click
  • Label
  • List Box
    Updated
  • Loader
  • Marker
  • Menu
  • Menubar
  • Message
  • Meter
  • Morphic Toast
  • Navigation Menu
  • Number Field
  • Option Picker
  • Orb
  • Pagination
  • Popover
  • Preview Card
    Updated
  • Progress
  • Radio
  • Resizable
  • Ruler Picker
  • Scroll Area
  • Scroll Bar
  • Select
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Switch
  • Table
  • Tabs
  • Text
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Toolbar
  • Tooltip
  • Waveform
  • Wheel Picker

Loading...

Preview Skeleton

Installation Skeleton

Usage Skeleton

API Reference Skeleton

Sponsors

Support the development of XiodUI and help us build the best component library on Earth.

+++
Sponsor on GitHub

Draggable

Previous: Dot MatrixNext: Drawer

A floating panel the user can move, resize, minimize and maximize.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import {2  Draggable,3  DraggableBody,4  DraggableControls,5  DraggableFooter,6  DraggableHandle,7  DraggableHeader,8  DraggableResizeHandle,9  DraggableTitle10} from "xiod-ui/draggable";

Anatomy

1<Draggable>2  <DraggableHeader>3    <DraggableHandle />4    <DraggableTitle />5    <DraggableControls />6  </DraggableHeader>7  <DraggableBody />8  <DraggableFooter />9</Draggable>

API Reference

Detailed documentation of properties and options.

Draggable

Accepts render, plus every native <div> attribute.

PropTypeDefaultDescription
bounds
"none"|"viewport"|"parent"
viewport

What the panel can't be moved out of: the viewport, its

Dot MatrixDrawer
parent
element, or
none
to move freely. Kept when the window resizes.
closeOnEscape
boolean
false

Whether Escape, pressed inside the panel, closes it.

defaultHeight
number
300

The panel's starting height, in pixels.

defaultMaximized
boolean
false

Whether the panel starts maximized, when it isn't controlled.

defaultMinimized
boolean
false

Whether the panel starts minimized, when it isn't controlled.

defaultOpen
boolean
true

Whether the panel is shown at first, when it isn't controlled.

defaultWidth
number
360

The panel's starting width, in pixels.

defaultX
number
40

The panel's starting distance from the left edge of the viewport, in pixels.

defaultY
number
40

The panel's starting distance from the top edge of the viewport, in pixels.

isDraggable
boolean
true

Whether the panel can be moved, by its header or handle.

isResizable
boolean
true

Whether the panel can be resized from its corner.

labels
Partial<DraggableLabels>
–

Replaces the built-in text for this instance. See LabelsProvider to change it everywhere.

maxHeight
number
600

The tallest the panel can be resized to, in pixels.

maximized
boolean
–

Whether the panel fills the viewport. Use with onMaximizedChange to control it.

maxWidth
number
800

The widest the panel can be resized to, in pixels.

minHeight
number
160

The shortest the panel can be resized to, in pixels.

minimized
boolean
–

Whether the panel is minimized to its header. Use with onMinimizedChange to control it.

minWidth
number
240

The narrowest the panel can be resized to, in pixels.

onMaximizedChange
((maximized: boolean) => void)
–

Called when the panel is maximized or restored.

onMinimizedChange
((minimized: boolean) => void)
–

Called when the panel is minimized or restored.

onOpenChange
((open: boolean) => void)
–

Called with false when the panel is closed, by its close button or Escape.

onPositionChange
((position: DraggablePosition) => void)
–

Called with the new position as the panel moves.

onSizeChange
((size: DraggableSize) => void)
–

Called with the new size as the panel is resized.

open
boolean
–

Whether the panel is shown. Use with onOpenChange to control it.

position
DraggablePosition
–

The panel's position. Use with onPositionChange to control it.

resizeHandleProps
DraggableResizeHandleProps
–

Props for the built-in corner resize handle, such as a className.

size
DraggableSize
–

The panel's size. Use with onSizeChange to control it.

variant
"default"|"flat"|"expressive"
default

The visual style of the component.

DraggableBody

Accepts render, plus every native <div> attribute.

DraggableControls

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
closeIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

maximizeIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

minimizeIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

restoreIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

DraggableFooter

Accepts render, plus every native <div> attribute.

DraggableHandle

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
icon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

DraggableHeader

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
icon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

DraggableResizeHandle

Accepts render, plus every native <div> attribute.

DraggableTitle

Accepts render, plus every native <span> attribute.