FileFieldListItem
File card rendered in list mode for each selected file. Displays name, human-readable size, an optional progress bar and a remove button. Renders as a semantic <li> element.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-file-field-list-item> — renders as a semantic <li>. 5 internal parts: root card ①, file icon ②, content column ③ (name + meta + optional progress ④), and the actions zone ⑤ with the remove button.- 1.origam-file-field-list-item
- Root
- element. display: flex; align-items: center. Has background-color, border (1px solid), border-radius and padding from design tokens.
- 2.origam-file-field-list-item__icon
- OrigamIcon rendered from the fileIcon prop. flex-shrink: 0; color from --origam-file-field-list-item__icon---color.
- 3.origam-file-field-list-item__content
- Flex column: stacks __name, __meta and optional __progress. flex-grow: 1; min-width: 0 for truncation support.
- 4.origam-file-field-list-item__progress
- OrigamProgress bar. Rendered only when the progress prop is a number. height: 4px; rounded; has margin-top from token.
- 5.origam-file-field-list-item__actions
- Flex row of action buttons. flex-shrink: 0. Contains the remove OrigamBtn (flat, size="small").
API
Props
All props accepted by this component, with their type, default value and description.
- filerequiredFile—
- The native File object to display. Provides name and size.
- indexrequirednumber—
- Zero-based index of the file in the current selection. Passed back in the click:remove emit payload.
- progressnumber
- Upload progress from 0 to 100. When defined, an OrigamProgress bar is rendered below the file meta.
- fileIconstringMDI_ICONS.FILE
- MDI icon name for the file type indicator. Defaults to the generic file icon.
- removeIconstringMDI_ICONS.CLOSE
- MDI icon for the remove button. Defaults to mdi-close.
- downloadIconstring
- downloadableboolean
- disabledbooleanfalse
- Disables the remove button.
- readonlybooleanfalse
- Makes the remove button non-interactive without altering its visual state.
- showSizeboolean | 1000 | 1024
- Controls the SI base for the human-readable file size display. true uses the default base; 1000 = SI (kB), 1024 = IEC (KiB).
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Intent or custom color applied to the progress bar.
- fontSizeTFontSize
- fontWeightTFontWeight
API
Slots
Content slots exposed by this component.
- #default
- Replaces the entire card content (icon + name + meta + progress + remove button) with custom markup.
API
Emits
Events emitted by this component.
- @click:remove{ file: File, index: number }
- Fired when the user clicks the remove button. Payload carries the File reference and its index so the parent can splice the selection array.
- @click:download{ file: File, index: number }
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to child components.
- Ref<string>
- Reactive CSS string generated by useStyle from the computed root styles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Card background color.
- Card border color.
- Card border width.
- Card border style.
- Card corner radius (6px as fallback in the .vue; closest token is radius.sm = 4px).
- Gap between the icon, content column and actions zone.
- Block (top/bottom) padding of the card.
- Inline (left/right) padding of the card.
- Color of the file type icon glyph.
- Font size for the file name label.
- Font weight for the file name label.
- Color of the file size / meta text.
- Font size for the file size / meta text.
- Top margin of the progress bar inside the content column.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Enter / Space | Activates the remove button when focused — native <button> behaviour. |
| Tab | Moves focus to the remove button and then to the next interactive element. |
Notes
- The root element is a semantic <li>. It must be used inside a <ul> (provided by OrigamFileField in list display mode) to satisfy the HTML content model.
- The remove button is a native <button> (via OrigamBtn). It is disabled when disabled=true or readonly=true.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- colorvar(--origam-color__surface---overlay)
- Card background color.
- colorvar(--origam-color__border---subtle)
- Card border color.
- dimensionvar(--origam-radius---sm)
- Card corner radius.
- dimensionvar(--origam-space---3)
- Gap between icon, content and actions (12px).
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Standalone list item