File Preview

Last modified by Manuel Leduc on 2024/11/25 16:18

Description

The file preview extension provides UI component to display files and file properties.

User

N/A

Admin

N/A

Developer

Package name @xwiki/cristal-file-preview-ui

File Preview

  • name: FilePreview

Props

import { Attachment } from "@xwiki/cristal-attachments-api";
type Props = { attachment: Attachment }

Usage

<script type="ts" setup>
import { FilePreview } from "@xwiki/cristal-file-preview-ui";
const attachment = ...;
</script>

<template>
<file-preview :attachment="attachment" />
</template>

Display a preview of the file, or a generic "No preview available" message if the mime type of the provided attachment is not supported.

File Size

  • name: FileSize

Props

FileSize

type Props = { size: number }

The size is the file size in bytes.

Usage

<script type="ts" setup>
import { FileSize } from "@xwiki/cristal-file-preview-ui";
</script>

<template>
<file-size :size="4569" />
</template>

Display the file size in human-readable way.

France 2030 Logo

This project is being financed by the French State as part of the France 2030 program

Ce projet est financé par l’État Français dans le cadre de France 2030

  • Powered by XWiki 16.4.4-node1. Hosted and managed by XWiki SAS

Get Connected