FileField

Renders a file reference as a downloadable link.

Installation

pnpm dlx shadcn@latest add @chelone/file-field
Loading preview…

Renders a file reference as a downloadable link.

Props

PropTypeDefaultDescription
cellClassNamestring—A class name to apply to the cell element when used inside `<DataTable>`.
classNamestring—A class name to apply to the root element.
defaultValueSourceValue<RecordType, SourceProp<RecordType>>—
downloadstring—
emptyReactNode—The node to display when the field value is empty. Defaults to nothing. A string is translated; a ReactNode renders as-is.
headerClassNamestring—A class name to apply to the header cell element when used inside `<DataTable>`.
labelReactNode—Label to use as column header when using `<DataTable>` or `<SimpleShowLayout>`. Defaults to the capitalized field name. Set to `false` to disable the label.
pingstring—
recordRecordType—The record to render. Defaults to the ambient `RecordContext` value.
relstring—
resourcestring—The resource name. Defaults to the ambient `ResourceContext` value.
sortableboolean—Disable the header click handler when used inside `<DataTable>`.
sortBystring—The field to sort by when this column head is clicked, if sortable.
sortByOrderSortOrder—The order used for sorting when this column head is clicked, if sortable.
sourceSourceProp<RecordType>—Name of the property to display (dot/bracket path).
srcstring—The path to the file url on each item, for an array of files.
targetstring—
textAlignTextAlign—The text alignment for the cell content, when used inside `<DataTable>`.
titlestring—The path to the display title (or a literal label).