docs/components/input/FileInput

FileInput

File upload input with drag support.

import { FileInput } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#Props

PropTypeDefaultDescription
valueFile | File[] | nullCurrently selected file(s).
onChange *(files: File | File[] | null) => voidCallback when files are selected or removed.
mode'single' | 'list''single'Selection mode: 'single' for one file, 'list' for multiple.
acceptstring'*'Accepted MIME types or file extensions.
maxSizenumberMaximum file size in bytes.
placeholderstring'Choose a file'Placeholder text shown when no files are selected.
disabledbooleanfalseDisable file selection.
classstringAdditional CSS classes.
styleJSX.CSSPropertiesCustom styles.

* required prop.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-accent-alpha
  • --sk-bg-secondary
  • --sk-bg-tertiary
  • --sk-border
  • --sk-error
  • --sk-error-alpha
  • --sk-file-input-bg
  • --sk-file-input-border
  • --sk-file-input-file-bg
  • --sk-file-input-radius
  • --sk-font-size-md
  • --sk-font-size-sm
  • --sk-font-size-xs
  • --sk-radius-md
  • --sk-radius-sm
  • --sk-space-md
  • --sk-space-sm
  • --sk-space-xl
  • --sk-space-xs
  • --sk-text-muted
  • --sk-text-primary