File Selector
- HTML/CSS:Dev Ready
- Layout:Responsive
The File selector component allows the user to select file(s) from a user’s file system. Either natively using an file input or drag and drop.
Base
Preview
About File Selector
Accessibility
When implementing this component, pay special attention to the following:
Notable attributes
aria-labelledbyis placed on the HTMLinputto form an "Accessible Label" from 2 seperate visible text labels, by referencing theiridattributes
Overview of CSS Classes
- Selector
- The CSS class being referred to.
- Summary
- A description of what the class does.
- Support
- Whether the class name is dev-ready (meaning it's fully vetted and tested and safe to use) or prototype (which means it's not fully vetted yet).
- Restrict
- The selector that the class name is allowed to be used on.
- Variant
- The base level pattern for a component. A variant can be extended to create another variant of that component, for example, a stateful button is a derivative of the base button.
- Modifier
- A single class that can be added to an HTML element of a component to modify its output. Typically these will be colors, sizing and positioning.
| Selector | .slds-file-selector |
|---|---|
| Summary | |
| Support | dev-ready |
| Restrict | div |
| Variant | True |
| Selector | .slds-file-selector__dropzone |
|---|---|
| Summary | Region that a file can be dropped within |
| Restrict | .slds-file-selector div |
| Selector | .slds-has-drag-over |
|---|---|
| Summary | |
| Restrict | .slds-file-selector__dropzone |
| Modifier | True |
| Selector | .slds-file-selector__input |
|---|---|
| Summary | Hidden input element |
| Restrict | .slds-file-selector input |
| Selector | .slds-file-selector__button |
|---|---|
| Summary | Faux button |
| Restrict | .slds-file-selector button, .slds-file-selector span |
| Selector | .slds-file-selector_files |
|---|---|
| Summary | Modifications based on context Single Line Dedicated dropzone when there are multiple dropzones in the form or when the input is positioned among other form inputs. |
| Restrict | .slds-file-selector |
| Selector | .slds-file-selector__body |
|---|---|
| Summary | Container for file selector content, specifically within the dropzone |
| Restrict | .slds-file-selector label |
| Selector | .slds-file-selector__text |
|---|---|
| Summary | Descriptive call back text |
| Restrict | .slds-file-selector span |
| Selector | .slds-file-selector_images |
|---|---|
| Summary | Multi Line / Image Use as a dedicated dropzone for image files only. May require a cropping control. |
| Support | dev-ready |
| Restrict | .slds-file-selector |
| Variant | True |
| Selector | .slds-file-selector_integrated |
|---|---|
| Summary | Invisible Dropzone (Container) Use when an entire container should be droppable. The container should have a visible boundary, like a modal, composer, or page. |
| Support | dev-ready |
| Restrict | .slds-file-selector |
| Variant | True |
| Selector | .slds-file-selector__dropzone_integrated |
|---|---|
| Summary | Specific to integrated file selector — region that a file can be dropped within |
| Restrict | .slds-file-selector_integrated div |
| Selector | .slds-has-drag |
|---|---|
| Summary | Informs dropzone that file has been dragged into the viewport |
| Restrict | .slds-file-selector__dropzone_integrated |
| Modifier | True |
| Selector | .slds-has-drag-over |
|---|---|
| Summary | Informs dropzone that file has been dragged into its region |
| Restrict | .slds-file-selector__dropzone_integrated |
| Modifier | True |
| Selector | .slds-file-selector__body_integrated |
|---|---|
| Summary | Specific to integrated file selector — container for file selector content, specifically within the dropzone |
| Restrict | .slds-file-selector_integrated label |
| Selector | .slds-file-selector__text_integrated |
|---|---|
| Summary | Specific to integrated file selector — Descriptive call back text |
| Restrict | .slds-file-selector_integrated span |