runway

Runway

File Input

A file input component for selecting files



The FileInput component provides an interface for selecting files. It features a customizable button with an icon and displays the selected file name.




Usage

javascript

1import FileInput from "@/components/atoms/FileInput";
2
3<FileInput
4    onFileChange={(file) => console.log(file)}
5/>



Props

PropTypeDefaultDescription
textstring"Drop files here, or click to select"The text to display in the component.
placeholderstring"No file selected"The placeholder text to display when no file is selected.
colorstring"gray"The base color (use tailwind.config).
borderRadiusstring"lg"The border radius of the component (uses Tailwind classes).
borderbooleantrueIf true, a border is displayed around the component.
iconReactNode<FiFilePlus />The icon to display in the component.
classNamestring""Additional Tailwind utility classes.
buttonClassNamestring""Additional Tailwind utility classes for the button.
inputClassNamestring""Additional Tailwind utility classes for the input.
onFileChangefunction-The function to call when a file is selected.
...propsobject-Any other valid HTML attributes.



Examples

Basic Usage


Customized FileInput