Grapes homepage1.57.0
  • Guide
  • Tokens
  • Components
    Grapes on GithubGrapes on Figma
    Interaction
    • Button
    • IconButton
    • FloatingActionBar
    • Link
    Icons
    • Icon
    • HighlightIcon
    Form
    • AmountInput
    • Autocomplete
    • AutocompleteMultiple
    • AutocompletePlace
    • CheckboxBox
    • CheckboxField
    • DatePicker
    • FormField
    • Input
    • OptionGroup
    • PasswordInput
    • PhoneInput
    • RadioBox
    • RadioField
    • RadioGroup
    • Select
    • SwitchField
    • TextArea
    • TextInput
    • Upload
    • UploadButton
    Feedback
    • Badge
    • Banner
    • Callout
    • EmptyState
    • Modal
    • ModalSlideshow
    • DeprecatedModalSlideshow
    • PageModal
    • Skeleton
    • Tag
    • Toast
    • Tooltip
    Data display
    • Accordion
    • Avatar
    • Box
    • Calendar
    • CalendarRange
    • CollapsibleList
    • FileCard
    • InfoTip
    • ListBox
    • ListView
    • Panel
    • SidePanel
    • DeprecatedPreview
    • Table
    • Timeline
    • useDateFormatter
    Navigation
    • DropdownItem
    • DropdownMenu
    • Navigation
    • NavigationItem
    • Popover
    • Tabs

    FileCard

    This component is used to display a condensed view of a file. When clicked, the user should expect to see a detailed version.

    View source code
    • Usage
    • Props

    Basic usage

    The mimeType prop displays the icon corresponding to the file's MIME type. It displays an unknown icon if the prop or the MIME type is not found.

    <>
      <FileCard
        title="Filename.pdf"
        description="Uploaded on November 4, 2020"
        mimeType="application/pdf"
        onClick={() => {}}
      />
      <FileCard
        title="Filename.pdf"
        description="Uploaded on November 4, 2020"
        mimeType="image/png"
        onClick={() => {}}
      />
      <FileCard
        title="Filename.pdf"
        description="Uploaded on November 4, 2020"
        onClick={() => {}}
      />
    </>
    

    Delete

    The onDelete prop lets you define an action to execute when the delete icon appears. The icon will only appear if the prop is present.

    <FileCard onDelete={onDeleteFile} {...otherProps} />
    

    Highlighted

    The isHighlighted prop lets you specify whether the FileCard component should be highlighted.

    <FileCard isHighlighted {...otherProps} />