kibana/packages/shared-ux/file/file_picker/impl
Vadim Kibana c65b2a620b
<FilePicker> file delete icon (#148471)
## Summary

Adds delete icon to top-right corner of thumbnails in file picker.

<img width="58" alt="image"
src="https://user-images.githubusercontent.com/82822460/210840710-4c2da19d-1aa1-43bf-a4af-3bc7c5d1ff49.png">

- Allows to specify a *predicate* function, which controls if the delete
button is shown for a file.
- Implements the predicate function inside the `image_embeddable`
plugin, such as to show the button only for files that user themselves
uploaded.

Closes https://github.com/elastic/kibana/issues/144695
Closes https://github.com/elastic/kibana/pull/144980

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-09 23:07:31 +01:00
..
src <FilePicker> file delete icon (#148471) 2023-01-09 23:07:31 +01:00
index.tsx
jest.config.js
kibana.jsonc Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.mdx
tsconfig.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00

---
id: sharedUX/Components/FilePicker
slug: /shared-ux/components/file-picker
title: File picker
description: Pick or upload files from Kibana.
tags: ['shared-ux', 'component', 'files']
date: 2022-11-22
---

## Description

A component designed to capture the UX of picking files. Use cases include:

* A dashboard user wanting to upload an image to their dashboard
* A user picking a new avatar
* A cases user selecting from a set of text files they want to attach to a case
* ...and many more

## Usage

Must be wrapped in the `FilesContext`.

```tsx
<FilesContext ...>
  <FilePicker ... />
</FilesContext>
```