SelectFileButton

Type: React component

How to get SelectFileButton?

JavaScript

import { SelectFileButton } from 'fds/components';

Renders a Button which triggers a native file dialog, allowing the user to select a file. Generally used as a trigger for a file upload action. The allowed file types (MIME types) can be specified using a prop.

Props

  1. icon

    (Optional)

    Type: String

    The name of the icon displayed in the component.

    This should be one of the Font Awesome icons. Do not include the fa- prefix, just use the icon names as-is from the documentation.

    Default value

  2. iconAfter

    (Optional)

    Type: String

    The name of the icon displayed after the component.

    This should be one of the Font Awesome icons. Do not include the fa- prefix, just use the icon names as-is from the documentation.

    Default value

  3. isDisabled

    (Optional)

    Type: Boolean

    Whether or not the component should be rendered in a disabled state.

    Default value

  4. label

    (Optional)

    Type: String

    The human readable label displayed in the component.

    Default value

  5. mimeTypesToAccept

    (Optional)

    Type: String

    Specifies which MIME types are accepted for upload.

    For more information about MIME types, check the MDN documentation

    Default value

  6. onClick

    (Optional)

    Type: Function

    A callback that is called whenever the component is clicked and is not in a disabled state.

    For more information about React and "events", check the React documentation

    Arguments

    Default value

  7. onSelect

    (Required)

    Type: Function

    A callback that is called whenever a file is selected.

    Arguments

  8. tooltipContent

    (Optional)

    Type: String | ReactElement

    The content of the tooltip that is displayed when hovering over the whole component.

    • string: the textual content of the tooltip

    • ReactElement: a React Element (instance of a React Component, usually created with JSX)

    Default value