Box
Map

JavaScript/jQuery FileManager Options

This section describes properties that configure the FileManager UI component's contents, behavior, and appearance.

accessKey

Specifies the shortcut key that sets focus on the UI component.

Type:

String

| undefined
Default Value: undefined

The value of this property will be passed to the accesskey attribute of the HTML element that underlies the UI component.

activeStateEnabled

Specifies whether the UI component changes its visual state as a result of user interaction.

Type:

Boolean

Default Value: false

The UI component switches to the active state when users press down the primary mouse button. When this property is set to true, the CSS rules for the active state apply. You can change these rules to customize the component.

Use this property when you display the component on a platform whose guidelines include the active state change for UI components.

allowedFileExtensions

Specifies the allowed upload file extensions.

Type:

Array<String>

Default Value: []

View Demo

The FileManager UI component cannot upload a file and displays an error message when the file's extension is not allowed.

DevExtreme File Manager - Allowed File Extension

contextMenu

Configures the context menu settings.

Type: dxFileManagerContextMenu

currentPath

Specifies the path that is used when the FileManager is initialized.

Type:

String

Default Value: ''

View Demo

currentPathKeys

Specifies an array of path keys to the current location.

Type:

Array<String>

Default Value: []

Each path part has each own key. For example, path "directory1/directory2" has two parts: 'directory1' with the 'f1' key and directory2 with the 'f2' key. To open this location, assign the ["f1","f2"] array of strings to the currentPathKeys property value.

customizeDetailColumns

Customizes columns in details view. Applies only if itemView.mode is "details".

Type:

Function

Function parameters:

The columns before customization.

The columns after customization.

customizeThumbnail

Allows you to provide custom icons to be used as thumbnails.

Type:

Function

Function parameters:
fileSystemItem:

FileSystemItem

The file or directory whose thumbnail is being customized.

Return Value:

String

An icon to use as a thumbnail.

This function should return one of the following:

View Demo

disabled

Specifies whether the UI component responds to user interaction.

Type:

Boolean

Default Value: false

elementAttr

Specifies the global attributes to be attached to the UI component's container element.

Type:

Object

Default Value: {}

  • $(function(){
  • $("#fileManagerContainer").dxFileManager({
  • // ...
  • elementAttr: {
  • id: "elementId",
  • class: "class-name"
  • }
  • });
  • });

fileSystemProvider

Specifies the file system provider.

Type: any
Default Value: null

File system providers are components that provide APIs used to access and modify virtual file systems.

Refer to File System Providers for information on supported file system providers.

The following example illustrates how to configure an Object file system provider:

focusedItemKey

Specifies a key of the initially or currently focused item.

Type:

String

Default Value: null

focusStateEnabled

Specifies whether the UI component can be focused using keyboard navigation.

Type:

Boolean

Default Value: false

height

Specifies the UI component's height.

Type:

Number

|

String

|

Function

| undefined
Return Value:

Number

|

String

The UI component's height.

Default Value: undefined

This property accepts a value of one of the following types:

  • Number
    The height in pixels.

  • String
    A CSS-accepted measurement of height. For example, "55px", "20vh", "80%", "inherit".

  • Function (deprecated since v21.2)
    Refer to the W0017 warning description for information on how you can migrate to viewport units.

hint

Specifies text for a hint that appears when a user pauses on the UI component.

Type:

String

| undefined
Default Value: undefined

hoverStateEnabled

Specifies whether the UI component changes its state when a user pauses on it.

Type:

Boolean

Default Value: false

itemView

Configures the file and directory view.

Type:

Object

Default Value: null

NOTE
Set the itemView.mode property to details to configure columns in the UI component.

View Demo

DevExtreme File Manager - Item View

notifications

Configures notification settings.

Type:

Object

onContentReady

A function that is executed when the UI component is rendered and each time the component is repainted.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

FileManager

The UI component's instance.

Default Value: null

onContextMenuItemClick

A function that is executed when a context menu item is clicked.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

fileSystemItem

FileSystemItem

The file system item for which you invoke the context menu.

itemData

Object

The clicked item's data.

itemElement

HTMLElement | jQuery

The item's container. It is an HTML Element or a jQuery Element when you use jQuery.

itemIndex

Number

The clicked item's index.

viewArea

FileManagerViewArea

Specifies whether the context menu is invoked in the navigation panel or in the items area.

Default Value: null

View Demo

onContextMenuShowing

A function that is executed before a context menu is displayed.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
cancel

Boolean

Allows you to cancel showing the context menu.

component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

fileSystemItem

FileSystemItem

The file system item for which you invoke the context menu.

targetElement

HTMLElement | jQuery

The file system item's container. It is an HTML Element or a jQuery Element when you use jQuery. This element can be a grid element or a thumbnail (for the items view area), or a tree view node (for the navigation panel). The targetElement field value is 'undefined' if you click on empty space in the items view area.

viewArea

FileManagerViewArea

Specifies whether the context menu is invoked in the navigation panel or in the items view area.

Default Value: null

View Demo

See Also

onCurrentDirectoryChanged

A function that is executed when the current directory is changed.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

directory

FileSystemItem

The current directory.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

Default Value: null

onDirectoryCreated

A function that is executed when a directory is created.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

name

String

The name of the created directory.

parentDirectory

FileSystemItem

The parent directory.

Default Value: null

Use the Create Directory context menu or toolbar item to invoke the dialog. In the dialog, enter the directory name and click Create to create a new directory.

DevExtreme File Manager - Create Directory

See Also

onDirectoryCreating

A function that is executed before a directory is created.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<void> (jQuery or native)

Allows you to cancel the directory creation.

component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

name

String

The name of the directory.

parentDirectory

FileSystemItem

The parent directory.

Default Value: null

Use the Create Directory context menu or toolbar item to invoke the dialog. In the dialog, enter the directory name and click Create to create a new directory.

The component executes the onDirectoryCreating function when a user enters a directory name and clicks Create in the dialog.

DevExtreme File Manager - Create Directory

See Also

onDisposing

A function that is executed before the UI component is disposed of.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

FileManager

The UI component's instance.

Default Value: null

onErrorOccurred

A function that is executed when an error occurs.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

fileSystemItem

FileSystemItem

The processed file or directory.

Default Value: null

onFileUploaded

A function that is executed when a file is successfully uploaded.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

fileData

File

The uploaded file.

parentDirectory

FileSystemItem

The parent directory.

Default Value: null

Use the Upload Files context menu or toolbar item to invoke the "Open" dialog and select a file to upload.

DevExtreme File Manager - Upload Files

See Also

onFileUploading

A function that is executed before the file is uploaded.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<void> (jQuery or native)

Allows you to cancel the file upload.

component

FileManager

The UI component's instance.

destinationDirectory

FileSystemItem

The directory where a file is uploaded to.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

fileData

File

The file to be uploaded.

Default Value: null

Use the Upload Files context menu or toolbar item to invoke the "Open" dialog and select a file to upload.

The component executes the onFileUploading function when a user clicks Open in the dialog.

DevExtreme File Manager - Upload Files

See Also

onFocusedItemChanged

A function that is executed when the focused item is changed.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

item

FileSystemItem

The currently focused file or directory.

itemElement

HTMLElement | jQuery

The item's container. It is an HTML Element or a jQuery Element when you use jQuery.

Default Value: null

onInitialized

A function used in JavaScript frameworks to save the UI component instance.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

FileManager

The UI component's instance.

Default Value: null

See Also
  • Get a UI component Instance in jQuery

onItemCopied

A function that is executed when a file or directory is copied.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

itemName

String

The name of the copied file or directory.

itemPath

String

The path to the copied file or directory.

parentDirectory

FileSystemItem

The parent directory.

sourceItem

FileSystemItem

The copied file or directory.

Default Value: null

Select a file/folder and use the Copy To context menu or toolbar item to invoke the "Copy to" dialog. In the dialog, select the destination directory and click Copy.

DevExtreme File Manager - Copy File or directory

DevExtreme File Manager - Copy File or directory

See Also

onItemCopying

A function that is executed before a file or directory is copied.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<void> (jQuery or native)

Allows you to cancel the file or directory copy process.

component

FileManager

The UI component's instance.

destinationDirectory

FileSystemItem

The directory where the file or directory is being copied to.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

item

FileSystemItem

The file or directory to be copied.

Default Value: null

Select a file/folder and use the Copy To context menu or toolbar item to invoke the "Copy to" dialog. In the dialog, select the destination directory and click Copy.

The component executes the onItemCopying function when a user clicks Copy in the dialog.

DevExtreme File Manager - Copy File or directory

DevExtreme File Manager - Copy File or directory

See Also

onItemDeleted

A function that is executed when a file or directory is deleted.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

item

FileSystemItem

The deleted file or directory.

Default Value: null

Select a file/folder and click the Delete context menu or toolbar item. In the confirmation dialog, click "Delete" to delete the file/folder.

DevExtreme File Manager - Copy File or directory

See Also

onItemDeleting

A function that is executed before a file or directory is deleted.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<void> (jQuery or native)

Allows you to cancel the file or directory deletion.

component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

item

FileSystemItem

The file or directory to be deleted.

Default Value: null

Select a file/folder and click the Delete context menu or toolbar item. In the confirmation dialog, click "Delete" to delete the file/folder.

The onItemCopying function is executed when a user clicks Delete in the confirmation dialog.

DevExtreme File Manager - Copy File or directory

See Also

onItemDownloading

A function that is executed before a file is downloaded.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<void> (jQuery or native)

Allows you to cancel the file download.

component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

item

FileSystemItem

The file to be downloaded.

Default Value: null

Select a file and use the Download context menu or toolbar item.

The component executes the onItemDownloading function when a user clicks Download in the dialog.

See Also

onItemMoved

A function that is executed when a file or directory is moved.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

itemName

String

The name of the moved file or directory.

itemPath

String

The path to the moved file or directory.

parentDirectory

FileSystemItem

The parent directory.

sourceItem

FileSystemItem

The moved file or directory.

Default Value: null

Select a file/folder and use the Move To context menu or toolbar item to invoke the "Move to" dialog. In the dialog, select the destination directory and click Move.

DevExtreme File Manager - Move File or directory

See Also

onItemMoving

A function that is executed before a file or directory is moved.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<void> (jQuery or native)

Allows you to cancel the file or directory move process.

component

FileManager

The UI component's instance.

destinationDirectory

FileSystemItem

The directory where a file is moved to.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

item

FileSystemItem

The file or directory to be moved.

Default Value: null

Select a file/folder and use the Move To context menu or toolbar item to invoke the "Move to" dialog. In the dialog, select the destination directory and click Move.

The component executes the onItemMoving function when a user clicks Move in the dialog.

DevExtreme File Manager - Move File or directory

See Also

onItemRenamed

A function that is executed when a file or directory is renamed.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

itemName

String

The current name of the renamed file or directory.

sourceItem

FileSystemItem

The renamed file or directory.

Default Value: null

Select a file/directory and click the Rename context menu or toolbar item to invoke the dialog. In the dialog, enter a new name and click Save.

DevExtreme File Manager - Move File or Directory

See Also

onItemRenaming

A function that is executed before a file or directory is renamed.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
cancel

Boolean

|

Promise<void> (jQuery or native)

Allows you to cancel the file or directory rename.

component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The component's container. It is an HTML Element or a jQuery Element when you use jQuery.

errorCode

Number

The error code. The following error codes are supported:

  • NoAccess = 0

  • FileExists = 1

  • FileNotFound = 2

  • DirectoryExists = 3

  • DirectoryNotFound = 4

  • WrongFileExtension = 5

  • MaxFileSizeExceeded = 6

  • Other = 32767

errorText

String

Allows you to specify the error message.

item

FileSystemItem

The file or directory to be renamed.

newName

String

The new name of the file or directory. This parameter is read-only.

Default Value: null

Select a file/directory and click the Rename context menu or toolbar item to invoke the dialog. In the dialog, enter a new name and click Save.

The component executes the onItemRenaming function when a user enters a new file/directory name and clicks Save in the dialog.

DevExtreme File Manager - Move File or Directory

See Also

onOptionChanged

A function that is executed after a UI component property is changed.

Type:

Function

Function parameters:

Information about the event.

Object structure:
Name Type Description
value any

The modified property's new value.

previousValue any

The UI component's previous value.

name

String

The modified property if it belongs to the first level. Otherwise, the first-level property it is nested into.

fullName

String

The path to the modified property that includes all parent properties.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

FileManager

The UI component's instance.

Default Value: null

The following example shows how to subscribe to component property changes:

index.js
  • $(function() {
  • $("#fileManagerContainer").dxFileManager({
  • // ...
  • onOptionChanged: function(e) {
  • if(e.name === "changedProperty") {
  • // handle the property change here
  • }
  • }
  • });
  • });

onSelectedFileOpened

A function that is executed when the selected file is opened.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

file

FileSystemItem

The opened file.

Default Value: null

onSelectionChanged

A function that is executed when a file system item is selected or selection is canceled.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

currentDeselectedItemKeys

Array<String>

The keys of the file system items whose selection has been cleared.

currentSelectedItemKeys

Array<String>

The keys of the file system items that have been selected.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

selectedItemKeys

Array<String>

The keys of all selected file system items.

selectedItems

Array<FileSystemItem>

The currently selected file system items.

Default Value: null

onToolbarItemClick

A function that is executed when a toolbar item is clicked.

Type:

Function

Function parameters:

Information about the event that caused the function's execution.

Object structure:
Name Type Description
component

FileManager

The UI component's instance.

element

HTMLElement | jQuery

The UI component's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is an EventObject or a jQuery.Event when you use jQuery.

itemData

Object

The clicked item's data.

itemElement

HTMLElement | jQuery

The item's container. It is an HTML Element or a jQuery Element when you use jQuery.

itemIndex

Number

The clicked item's index.

permissions

Specifies actions that a user is allowed to perform on files and directories.

Type:

Object

View Demo

rootFolderName

Specifies the root directory display name.

Type:

String

Default Value: 'Files'

rtlEnabled

Switches the UI component to a right-to-left representation.

Type:

Boolean

Default Value: false

When this property is set to true, the UI component text flows from right to left, and the layout of elements is reversed. To switch the entire application/site to the right-to-left representation, assign true to the rtlEnabled field of the object passed to the DevExpress.config(config) method.

JavaScript
  • DevExpress.config({
  • rtlEnabled: true
  • });

DataGrid Demo Navigation UI Demo Editors Demo

selectedItemKeys

Contains an array of initially or currently selected files and directories' keys.

Type:

Array<String>

Default Value: []

selectionMode

Specifies whether a user can select a single or multiple files and directories in the item view simultaneously.

Default Value: 'multiple'

NOTE
The check boxes that select/unselect individual items are displayed only in multiple selection mode.

tabIndex

Specifies the number of the element when the Tab key is used for navigating.

Type:

Number

Default Value: 0

The value of this property will be passed to the tabindex attribute of the HTML element that underlies the UI component.

toolbar

Configures toolbar settings.

Type: dxFileManagerToolbar

View Demo

DevExtreme File Manager - Toolbar

The FileManager UI component allows you to add default and custom toolbar items.

Predefined Items

Predefined toolbar items include:

  • 'showNavPane' - Shows or hides the navigation panel.
  • 'create' - Creates a new directory.
  • 'upload' - Uploads a file.
  • 'refresh' - Refreshes the file manager content and shows the progress panel.
  • 'download' - Downloads a file.
  • 'move' - Moves files and directories.
  • 'copy' - Copies files and directories.
  • 'rename' - Renames files and directories.
  • 'delete' - Deletes files and directories.
  • 'switchView' - Switches between the 'Details' and 'Thumbnails' file system representation modes.
  • 'clearSelection' - Clears selection from files and directories in the Item View area.

To add a predefined item to the toolbar, specify its name and optional settings ('visible', 'location', 'locateInMenu', 'text', 'icon', 'disabled') and add the item to one of the following collections:

  • items - Displays toolbar items when no file system item is selected.

  • fileSelectionItems - Displays toolbar items when one or more file system items are selected.

NOTE
Note that optional settings for predefined toolbar items should be specified at the same level as the item's name property.

Custom Items

To add a custom toolbar item, specify its text and optional settings (for example, a file extension for the toolbar item that creates a new file) and add the item to one of the following collections:

  • items - Displays toolbar items when no file system item is selected.

  • fileSelectionItems - Displays toolbar items when one or more file system items are selected.

The widget property allows you to specify a UI component for a custom toolbar item (dxButton is the default UI component). Use the toolbarItemClick event to handle clicks on custom toolbar items.

upload

Configures upload settings.

Type:

Object

visible

Specifies whether the UI component is visible.

Type:

Boolean

Default Value: true

width

Specifies the UI component's width.

Type:

Number

|

String

|

Function

| undefined
Return Value:

Number

|

String

The UI component's width.

Default Value: undefined

This property accepts a value of one of the following types:

  • Number
    The width in pixels.

  • String
    A CSS-accepted measurement of width. For example, "55px", "20vw", "80%", "auto", "inherit".

  • Function (deprecated since v21.2)
    Refer to the W0017 warning description for information on how you can migrate to viewport units.