XiodUI
HomeDocs
OverviewComponentsThemes & ColorsChangelog
⌘ K

Components

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

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

File Upload

Previous: FieldsetNext: Form

A robust, fully styled compound file uploader supporting drag-and-drop, mime-type validation, and size constraints.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import {2  FileUpload,3  FileUploadTrigger,4  FileUploadInput,5  FileUploadList,6  FileUploadItem,7  FileUploadItemIcon,8  FileUploadItemName,9  FileUploadItemSize,10  FileUploadItemProgress,11  FileUploadItemStatus,12  FileUploadItemRemove,13  Attachment,14  AttachmentMedia,15  AttachmentContent,16  AttachmentTitle,17  AttachmentDescription,18  AttachmentActions,19  AttachmentAction,20  AttachmentTrigger,21  AttachmentGroup22} from "xiod-ui/file-upload";

Anatomy

1<FileUpload>2  <FileUploadTrigger />3  <FileUploadInput />4  <AttachmentTrigger />5  <AttachmentContent>6    <AttachmentTitle />7    <AttachmentDescription />8    <FileUploadList>9      <FileUploadItem />10    </FileUploadList>11    <AttachmentGroup>12      <FileUploadItem />13    </AttachmentGroup>14    <FileUploadItemIcon />15    <FileUploadItemName />16    <FileUploadItemSize />17    <FileUploadItemProgress />18    <FileUploadItemStatus />19    <FileUploadItemRemove />20    <Attachment />21    <AttachmentMedia />22    <AttachmentActions />23    <AttachmentAction />24  </AttachmentContent>25</FileUpload>

API Reference

Detailed documentation of properties and options.

FileUpload

PropTypeDefaultDescription
files
FileItem[]
|undefined
-
onFilesChange
((files: FileItem[]) => void)
|undefined
-
onFilesAdded
((files: File[]) => void)
|undefined
-
onFileRemove
((id: string) => void)
|undefined
-
maxFiles
number
|undefined
5
maxSizeMB
number
|undefined
10
accept
string
|undefined
-
disabled
boolean
|undefined
false

FileUploadTrigger

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadList

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadItem

PropTypeDefaultDescription
fileItemReq
FileItem
-
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadItemIcon

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadItemName

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadItemSize

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadItemProgress

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadItemStatus

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

FileUploadItemRemove

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

Attachment

PropTypeDefaultDescription
state
AttachmentState
|undefined
done
orientation
"horizontal"
|"vertical"
|null
|undefined
horizontal
size
"default"
|"sm"
|"xs"
|null
|undefined
default

AttachmentMedia

PropTypeDefaultDescription
variant
"image"
|"icon"
|null
|undefined
icon

AttachmentAction

PropTypeDefaultDescription
variant
"default"
|"link"
|"secondary"
|"destructive"
|"destructive-outline"
|"ghost"
|"outline"
|null
|undefined
-
size
"default"
|"sm"
|"lg"
|"xs"
|"xl"
|"icon"
|"icon-lg"
|"icon-sm"
|"icon-xl"
|"icon-xs"
|null
|undefined
icon-xs
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

AttachmentTrigger

PropTypeDefaultDescription
render
ReactElement<unknown, string
|JSXElementConstructor<any>>
|ComponentRenderFn<HTMLProps, {}>
|undefined
-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
FieldsetForm