Skip to content

FileField

FileField(props): Element

Defined in: packages/ui/src/fields/file-field.tsx:25

Read-only display component that renders a file reference with an icon, display name, and optional formatted file size.

Uses fileName if provided, otherwise falls back to the raw value string. File sizes are formatted as B/KB/MB. Returns an em-dash for null/undefined values.

FileFieldProps

See FileFieldProps.

Element

A <span> with a file icon, name, and size, or a placeholder for null values.

<FileField value="report.pdf" fileName="Q4 Report.pdf" fileSize={2048576} />
// -> "Q4 Report.pdf (2.0 MB)"