File
When to use it
Section titled “When to use it”- Use type dropzone where people add files: attachments in messages and support requests, room photos and verification documents in the back office.
- Use type item for each file once it is added, in a list under the drop zone, with its name, type and size.
- Show state uploading with the progress while a file is sending, and state error with the reason when a file is refused.
- Put the accepted types and the size limit in the Hint, such as “PDF, JPG or PNG · 10 MB each”.
- Say what went wrong and how to fix it in the error, such as “Too large: the limit is 10 MB”.
- Keep the whole drop zone clickable, so “browse” works without dragging, on touch screens too.
When not to use it
Section titled “When not to use it”- To show a document people download but never upload, such as a receipt or invoice: use a Link or a table row.
Instead: Link, table row - For a profile photo: use Avatar with its own upload action.
Instead: Avatar - Do not hide the limits: never leave the Hint empty.
The Figma page names no alternative.
Best practice
Section titled “Best practice”From the Figma documentation page (usage node 204:76), as written. These items aren’t carried into File.intent.json, which has no field for them.
- Put the accepted types and the size limit in the Hint, such as “PDF, JPG or PNG · 10 MB each”.
- Say what went wrong and how to fix it in the error, such as “Too large: the limit is 10 MB”.
- Keep the whole drop zone clickable, so “browse” works without dragging, on touch screens too.
What each variant is for
Section titled “What each variant is for”| Property | Value | What it is for |
|---|---|---|
type |
dropzone |
where people add files: attachments in messages and support requests, room photos and verification documents in the back office. |
type |
item |
for each file once it is added, in a list under the drop zone, with its name, type and size. |
Accessibility
Section titled “Accessibility”- The dropzone is a <label> wrapping a native <input type=“file”> (visually the whole zone), so clicking anywhere on it, or Tab then Enter/Space, opens the browser’s file picker and works on touch without dragging.
src/components/File/File.tsx:121 - The file input is described by the hint text (aria-describedby), so accepted types and size limit are announced with it.
src/components/File/File.tsx:137 - The input is natively disabled when disabled is set, and the dropzone shows a focus outline on keyboard focus.
src/components/File/File.tsx:136 - The item’s meta line has role=“alert” in state error, so the reason is announced.
src/components/File/File.tsx:72 - The item’s type badge is aria-hidden, and its Remove/Cancel action is a native <button type=“button”>.
src/components/File/File.tsx:67
What this version promises
Section titled “What this version promises”From Versioning (VERSIONING.md at b9ffb76):
0.3.0 adds six components on top of 0.2.1: Calendar, Card, Form, Modal, SideBar and Table. It contains twenty-three components, each exported from the package root with its props type: Avatar, Breadcrumbs, Button, ButtonGroup, Calendar, Card, Checkbox, Chip, Dropdown, File, Form, Header, Image, Link, Logo, Modal, ProgressBar, RadioCard, SearchBar, SideBar, Stepper, Table, Toggle. Textfield is exported from the package root as well, with TextfieldProps and TextfieldState, and is public like the others (see decisions.md, 2026-10-07, Textfield). It commits you to their props, prop values and defaults, their hz- class names, the tokens in tokens.css and the three entry points (., ./styles.css, ./tokens.css). Everything in 0.3.0 beyond 0.2.1 is an addition: nothing from 0.2.1 was changed, removed or renamed. A change that breaks any of these on 0.x bumps the version to 0.4.0.
Two things about this release are worth knowing:
- Form, Modal and Table each passed release review with their literal sizes covered by a ruling in decisions.md (Card, SideBar and Calendar have their own), because no size tokens exist for them. Those literals are accepted until the designer adds matching tokens, so a later change to use tokens at the same rendered sizes would be a patch, not a breaking change.
- Dark theme is not verified for Table, and its warning tag has low contrast. The Table docs page says so. Neither is a breaking-change risk, but a fix that changes a token’s value is a patch and is listed in the changelog.
Stories
Section titled “Stories”All Variants
Section titled “All Variants”Interactive
Section titled “Interactive”The single-variant stories (DropzoneDefault, DropzoneDragover, ItemUploaded, ItemUploading, ItemError, DropzoneCustomCopy, ItemImageFile) are cells of the variant matrix; the Design tab links each one.
Import
Section titled “Import”import { File } from "@layerbasesystemic/horizon-design-system";import type { FileProps, FileType, FileState } from "@layerbasesystemic/horizon-design-system";@layerbasesystemic/horizon-design-system/tokens.css and @layerbasesystemic/horizon-design-system/styles.css must be loaded too; see Developing.
File.tsx is built from ProgressBar: it imports it (File.tsx:4) and renders <ProgressBar> (File.tsx:76). The registry’s Composes column for File lists ProgressBar.
| Prop | Type | Default | Description |
|---|---|---|---|
type |
FileType |
"dropzone" |
Figma type. dropzone is the area to drop or browse; item is one added file. |
state |
FileState |
— | Figma state. Dropzone: default | dragover. Item: uploaded | uploading | error. |
title |
string |
"Drop a file or browse" |
Dropzone call to action. |
hint |
string |
"PDF, JPG or PNG · 10 MB each" |
Dropzone accepted types and size limit. Never leave empty. |
fileName |
string |
"flight-TK1734.pdf" |
Item file name. |
fileType |
string |
"PDF" |
Item type badge text, e.g. “PDF”. |
meta |
string |
— | Item meta line (uploaded: type and size; error: the reason). Uploading shows Uploading · {progress}%. |
progress |
number |
60 |
Item uploading progress, 0 to 100. |
actionLabel |
string |
— | Item action label. Defaults: Remove (uploaded, error), Cancel (uploading). |
onAction |
() => void |
— | — |
onFiles |
(files: FileList) => void |
— | Dropzone: files chosen by browsing or dropped. |
accept |
string |
— | Dropzone: accept and multiple for the native file input. |
multiple |
boolean |
— | — |
disabled |
boolean |
— | — |
FileProps also extends Omit<HTMLAttributes<HTMLDivElement>, "title" \| "children" \| "onDrop">, so native attributes pass through to the element (File.tsx:9).
Props that are not Figma properties. The stories’ header comment says: “Not Figma properties (added so the component is usable): progress, actionLabel, onAction, onFiles, accept, multiple, disabled. A dropzone with no state follows real drag events.” (File.stories.tsx:9-10). They are declared at progress, actionLabel, onAction, onFiles, accept, multiple, disabled.
From the release review, under “Findings outside the gates”, as written:
Props that are not Figma properties. progress, actionLabel, onAction, onFiles, accept, multiple and disabled (File.tsx:24-34), plus passthrough div attributes. The source header and the QA report say they were added so the component is usable. They are public API once published (a 0.x breaking-change surface under VERSIONING.md). Owner: a human, to accept them as intended API or ask the designer to draw them.
How type and state combine. Both are props, and FileState lists all five values whatever type is, so the code accepts pairs Figma does not publish. For type="item", a state other than uploading or error (including none) renders as uploaded (File.tsx:56). For type="dropzone", dragover is state === "dragover" when state is set, and follows the real drag events (over) when it is not (File.tsx:102, handlers at File.tsx:124); any other state on a dropzone renders as the default. Each Design tab cell is the story that sets type and state for that Figma variant.
Composition is not in the intent. File.tsx renders <ProgressBar> (File.tsx:76) for state="uploading", but pairs_with and placement in File.intent.json are empty.
From the release review, under “Findings outside the gates”, as written:
Empty placement and pairs_with. File imports and renders ProgressBar for state=uploading (File.tsx:4, :76) and the board row’s Composes is ProgressBar, but pairs_with is [], because the stories import only File. Check 1 allows an empty list. Owner: component-intent, if the team wants the composition recorded.
The exported name shadows a DOM global. File.tsx exports File, the same name as the browser’s File constructor.
From the release review, under “Findings outside the gates”, as written:
Name shadows a browser global. The exported symbol File has the same name as the DOM File constructor; a consumer who imports it without aliasing shadows the global in that module. The row, Figma and folder all say File, so G4 passes. Owner: a human, to accept it or rename before 1.0.
Union types
Section titled “Union types”FileType: dropzone, item
FileState: default, dragover, uploaded, uploading, error
Tokens it needs
Section titled “Tokens it needs”Every CSS custom property File.css reads, with its value in the token build at b9ffb76.
| Token | Light | Dark |
|---|---|---|
--border-width-md |
2px |
same as light |
--border-width-sm |
1px |
same as light |
--color-bg-elevated |
#f9fafb |
#4d5361 |
--color-bg-surface |
#f2f3f5 |
#272a37 |
--color-border-default |
#d7dee7 |
#4d5361 |
--color-border-focus |
#1d44ba |
#6692f8 |
--color-primary-default |
#2b5ad6 |
#6692f8 |
--color-primary-light |
#eff3ff |
#162d69 |
--color-status-error |
#d02727 |
#f36969 |
--color-text-disabled |
#d1d5db |
#6a7180 |
--color-text-link |
#1d44ba |
#94b3fc |
--color-text-primary |
#161925 |
#f9fafb |
--color-text-secondary |
#4d5361 |
#9ca2b1 |
--fontfamily-body |
Inter |
same as light |
--fontsize-lg |
13px |
same as light |
--fontsize-md |
12px |
same as light |
--fontsize-sm |
11px |
same as light |
--fontsize-xs |
10px |
same as light |
--lineheight-lg |
20px |
same as light |
--lineheight-md |
18px |
same as light |
--lineheight-sm |
16px |
same as light |
--lineheight-xs |
16px |
same as light |
--radius-xs |
2px |
same as light |
--spacing-md |
12px |
same as light |
--spacing-xl |
20px |
same as light |
--spacing-xs |
4px |
same as light |
This matches required_tokens in File.intent.json exactly.
Figma node
Section titled “Figma node”Page File (57:1642), documentation frame ❖ file (204:56), component set file (204:41). The file is shared with the team only, so the frame and the link ask anyone outside it to sign in.
Variant matrix
Section titled “Variant matrix”type (2) × state (5) = 10 combinations, of which Figma publishes 5 cells. The component set (204:41) publishes 5 variants, not the 10 that type x state would give: dropzone has default and dragover; item has uploaded, uploading and error. The documentation frame lays them out as two rows (type dropzone, type item) against the state columns. Title and Hint (dropzone) and File name, file type badge and meta (item) are properties of the set, not cells; the page draws them as the instances Back office photos (204:65) and Image file (204:69). Figma draws no hover, pressed, disabled or keyboard-focus states.
type |
state=default |
state=dragover |
state=uploaded |
state=uploading |
state=error |
|---|---|---|---|---|---|
dropzone |
DropzoneDefault, DropzoneCustomCopy204:6 |
DropzoneDragover204:9 |
not published in Figma | not published in Figma | not published in Figma |
item |
not published in Figma | not published in Figma | ItemUploaded, ItemImageFile204:12 |
ItemUploading204:19 |
ItemError204:34 |
Each cell is the Storybook story for that combination and its Figma variant node. FileType and FileState are the union types listed on the Code tab. Figma publishes 5 of the 10 combinations: type=dropzone, state=uploaded, type=dropzone, state=uploading, type=dropzone, state=error, type=item, state=default, type=item, state=dragover are not published, so the matrix has no cell or story for them. The stories that aren’t a single cell (AllVariants, Interactive) are embedded on the Examples tab.
Themes
Section titled “Themes”The file component set renders every cell once, in one theme. It has no separate light and dark frames.
The token build defines 179 tokens for light and redeclares 50 for dark; the Code tab shows File’s tokens in both.
Values Figma never bound
Section titled “Values Figma never bound”Values on the Figma node that aren’t bound to a variable, and what File.css at b9ffb76 does with each.
| Layer | Property | Figma value | In the code |
|---|---|---|---|
| Thumbnail, type=item (204:13, 204:20, 204:35) | width | 32px |
width: 32px; |
| Thumbnail, type=item (204:13, 204:20, 204:35) | height | 32px |
height: 32px; |
Figma variables against the token build
Section titled “Figma variables against the token build”| Figma variable | Figma value | Token in the build | Built light value | Agrees |
|---|---|---|---|---|
--color-text-primary |
#161925 |
--color-text-primary |
#161925 |
yes |
--fontSize-lg |
13 |
--fontsize-lg |
13px |
yes |
--fontWeight-medium |
Medium |
no such token | — | no token |
--fontFamily-body |
Inter |
--fontfamily-body |
Inter |
yes |
--lineHeight-lg |
20 |
--lineheight-lg |
20px |
yes |
--color-text-secondary |
#4d5361 |
--color-text-secondary |
#4d5361 |
yes |
--fontSize-sm |
11 |
--fontsize-sm |
11px |
yes |
--fontWeight-regular |
Regular |
no such token | — | no token |
--lineHeight-sm |
16 |
--lineheight-sm |
16px |
yes |
--spacing-xs |
4 |
--spacing-xs |
4px |
yes |
--spacing-xl |
20 |
--spacing-xl |
20px |
yes |
--radius-xs |
2 |
--radius-xs |
2px |
yes |
--border-width-sm |
1 |
--border-width-sm |
1px |
yes |
--color-bg-surface |
#f2f3f5 |
--color-bg-surface |
#f2f3f5 |
yes |
--color-border-default |
#d7dee7 |
--color-border-default |
#d7dee7 |
yes |
--color-primary-default |
#3b71f2 |
--color-primary-default |
#2b5ad6 |
no |
--color-primary-light |
#eff3ff |
--color-primary-light |
#eff3ff |
yes |
--fontSize-xs |
10 |
--fontsize-xs |
10px |
yes |
--lineHeight-xs |
16 |
--lineheight-xs |
16px |
yes |
--fontSize-md |
12 |
--fontsize-md |
12px |
yes |
--lineHeight-md |
18 |
--lineheight-md |
18px |
yes |
--color-text-link |
#1d44ba |
--color-text-link |
#1d44ba |
yes |
--spacing-md |
12 |
--spacing-md |
12px |
yes |
--color-bg-elevated |
#f9fafb |
--color-bg-elevated |
#f9fafb |
yes |
--radius-full |
999 |
--radius-full |
999px |
yes |
--color-status-error |
#ea3d3d |
--color-status-error |
#d02727 |
no |
--fontWeight-medium, --fontWeight-regular are bound in Figma but the token build has no token of that name.
2 colour variables in Figma still hold a different value from the token build, so the design file and the shipped component render --color-primary-default, --color-status-error differently.
Design gaps recorded against it
Section titled “Design gaps recorded against it”Colour drift. The Figma variables --color-primary-default (#3b71f2) and --color-status-error (#ea3d3d) hold different values from the token build; see the table above.
From the release review, under “Findings outside the gates”, as written:
Pipeline colour drift. –color-primary-default renders #2b5ad6 (Figma #3b71f2) and –color-status-error renders #d02727 (Figma #ea3d3d). Accepted drift under the ruling’s “Not ruled” paragraph and the QA report. Same as Button, Chip, Toggle and Dropdown.
States Figma doesn’t draw. The component description (node 204:41) and the matrix above cover dropzone default and dragover, and item uploaded, uploading and error only. The stylesheet dims a disabled dropzone with opacity: 0.6;, and has a keyboard-focus rule at File.css:49; Figma draws neither, nor a hover or pressed state.
From the release review, under “Findings outside the gates”, as written:
Unspecified states. The disabled prop dims the dropzone to opacity: 0.6 (File.css:54) and disables the item action (File.css:89); Figma draws no disabled, hover, pressed or focus state. The engineer added keyboard focus (focus-border outline on the dropzone, File.css:48-51; on the action, :84-87) and an underline on action hover. The 0.6 is the one the ruling leaves to the designer. Owner: the designer.
- 2026-10-04 · File thumbnail size with no token (decisions.md). These literals in src/components/File/File.css are accepted, because they are what the Figma node specifies, until the designer adds a matching size token. Accepted values:
32px(width (thumbnail),.hz-file__thumbnail, line 95);32px(height (thumbnail),.hz-file__thumbnail, line 96). Not ruled: Any other literal value, including a var() fallback. These values in any other component. A change to these values: a different number needs a new ruling or a token. The disabled prop’s 0.6 opacity, which Figma does not draw: it is unitless, and whether it should exist is for the designer. The primary and error colours, which use bound tokens (#2b5ad6, #d02727) and differ from the #3b71f2 and #ea3d3d Figma shows: that is accepted pipeline drift, not a gate finding. Any state Figma does not draw. - From the release review: Check 2: dont_use_when entry 3 (“Do not hide the limits: never leave the Hint empty.”) has an empty instead.
Every commit to src/components/File up to b9ffb76, newest first, with the published version that carries it.
| Commit | Date | Version | Change |
|---|---|---|---|
8c0433f |
2026-10-04 | 0.2.0 | File: add intent file from Figma usage frame 204:76 |
db7e1d5 |
2026-10-04 | 0.2.0 | File: strokes sit inside the box, padding minus border so cells match Figma heights |
4e14317 |
2026-10-04 | 0.2.0 | File: build from Figma 57-1642 (dropzone, item) |