Skip to content

GuuD/fable-file-input

Repository files navigation

Typed File Input Component

For Fable and Fable.React

MacOS/Linux Windows
Travis Badge Build status
Build History Build History

Nuget

Stable Prerelease
NuGet Badge NuGet Badge

Use singleFileInput from Fable.FileInput.React instead of regular input from Fable.Import.React if you want to handle inputs of single files without fighting with auto-bindings.

Event Handlers

  • OnFileBytesReceived of (FileInfo<JS.ArrayBuffer> -> unit)
  • OnDataUrlReceived of (FileInfo<string> -> unit)
  • OnTextReceived of (FileInfo<string> -> unit)

Where FileInfo is:

type FileInfo<'t> = { Name: string; MIME: string; Data: 't }

Example

open Fable.FileInput.React
open Fable.Helpers.React
open Props
let view model dispatch =
    div [] [
        singleFileInput [ClassName "button"; OnFileBytesReceived(YourMessage>>dispatch)]
    ]

Multiple Files

Will add soon tm

About

Small file input component for fable react

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published