• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.file.picker (Picker) (System API)
2<!--Kit: Core File Kit-->
3<!--Subsystem: FileManagement-->
4<!--Owner: @wang_zhangjun; @zhuangzhuang-->
5<!--Designer: @wang_zhangjun; @zhuangzhuang; @renguang1116-->
6<!--Tester: @liuhonggang123; @yue-ye2; @juxiaopang-->
7<!--Adviser: @foryourself-->
8
9The **Picker** module encapsulates APIs such as **PhotoViewPicker**, **DocumentViewPicker**, and **AudioViewPicker** to provide capabilities of selecting and saving files of different types. An application can select the API as required. The APIs of this module must be called in UIAbility. Otherwise, the **photoPicker** or **FilePicker** cannot be started.
10> **NOTE**
11>
12> - The initial APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
13> - This topic describes only the system APIs provided by the module. For details about its public APIs, see [@ohos.file.picker (Picker)](js-apis-file-picker.md).
14
15## Modules to Import
16
17```ts
18import  { picker } from '@kit.CoreFileKit';
19```
20
21## DocumentSelectOptions
22
23Defines the options for selecting documents.
24
25**Atomic service API**: This API can be used in atomic services since API version 12.<br>
26
27**System capability**: SystemCapability.FileManagement.UserFileService<br>
28
29### Properties
30
31| Name                   | Type                                        | Read-Only | Optional | Description                                    |
32| :---------------------- |---------------------------------------------| ---- | ---- |------------------------------------------|
33| themeColor<sup>18+</sup>     | [CustomColors](../apis-arkui/js-apis-arkui-theme.md#customcolors) |  No |  Yes|Theme color parameter. By default, it is left empty and follows the color settings of the **FilePicker**. When it is set to specific theme color properties, such as [brand, fontPrimary, compBackgroundEmphasize, and iconFourth](../apis-arkui/js-apis-arkui-theme.md#colors), the launched **FilePicker** will adapt to the theme color accordingly.<br> **System capability**: SystemCapability.FileManagement.UserFileService<br> **Device behavior differences**: This API can be called on mobile phones but has no effect on other devices.|
34
35## DocumentSaveOptions
36
37Defines the options for saving documents.
38
39**Atomic service API**: This API can be used in atomic services since API version 12.
40
41**System capability**: SystemCapability.FileManagement.UserFileService
42
43### Properties
44
45| Name                   | Type                                         |  Read-Only | Optional |Description                                      |
46| :---------------------- |---------------------------------------------| ----- |--------| ------------------------------------------|
47| themeColor<sup>18+</sup>     | [CustomColors](../apis-arkui/js-apis-arkui-theme.md#customcolors) |  No  | Yes| Theme color parameter. By default, it is left empty and follows the color settings of the **FilePicker**. When it is set to specific theme color properties, such as [fontEmphasize and compBackgroundEmphasize](../apis-arkui/js-apis-arkui-theme.md#colors), the launched **FilePicker** will adapt to the theme color accordingly.<br> **System capability**: SystemCapability.FileManagement.UserFileService<br> **Device behavior differences**: This API can be called on mobile phones but has no effect on other devices.|
48