Loading...
Installation
Install the following dependency:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
<app-file-icon />
Examples
Default
Loading...
Sizes
Loading...
Types
Loading...
API Reference
<app-file-icon>
The component renders an SVG. When type is omitted, it derives the icon type from the extension
in name and falls back to "file" when the extension is unknown.
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
name | string | "" | File name whose extension determines the icon when type is omitted. |
type | FileIconType | undefined | inferred | Explicitly selects the icon type instead of inferring it from name. |
title | string | undefined | — | Adds an SVG <title> and exposes the icon as an image to assistive technology. |
aria-label | string | undefined | — | Gives the rendered SVG an accessible name and exposes it as an image. |
aria-labelledby | string | undefined | — | References the element that labels the SVG and exposes it as an image. |
class | string | "" | Adds classes to the rendered SVG alongside the component's cn-file-icon class. |
The SVG is marked aria-hidden="true" when none of title, aria-label, or aria-labelledby is
provided.
FileIconType
type FileIconType = | "file" | "archive" | "document" | "spreadsheet" | "presentation" | "pdf" | "video" | "music" | "image";
Angular
React
Solid
Svelte
Vue