Getting Started
Overview
Installation
Theme
Forms
Basic Inputs
Custom Inputs
Select
Components
Components
77
Micro Charts
Navigation
Libraries
Content Editor
Data View
Form Renderer
Image Designer
Kanban Board
Video Player
Visual Builder
Latest npm version of @ngstarter-ui/componentsWeekly npm downloads of @ngstarter-ui/components
Purchase

File Type

File Type renders a compact SVG icon for a file based on a MIME type, extension, or file name. Use it in file lists, upload previews, attachment cards, media libraries, document pickers, and activity feeds where a file needs a clear visual type indicator.

The component resolves explicit extensions first, then file name extensions, then MIME types. Unknown files fall back to TXT by default, or to the fallback type you provide.

File Type only renders the icon. Pair it with Upload, List, Card, DataView, or Table when users need selection, progress, actions, metadata, or records around the file.

The NgStarter Angular File Type component renders built-in SVG file icons from a MIME type, extension, or file name. Use it for file lists, upload previews, document pickers, attachment cards, media libraries, and activity feeds where users need to scan file formats quickly. It includes examples for Basic file type, Icon sizes, MIME type detection, and File type gallery.

Basic File Type

Pass a file name or extension when you already have a client-side file record.

contract.pdf
Resolved from fileName
Financial model
Resolved from extension

Icon Sizes

Use Tailwind size utilities or component CSS sizing to render compact rows, medium cards, and large previews.

24 px
32 px
40 px
48 px
64 px
80 px

MIME Type Detection

Pass MIME types from File objects, upload APIs, or backend attachment metadata.

Brand mark
image/svg+xml
Podcast cut
audio/mpeg
Campaign deck
application/vnd.ms-powerpoint
Raw export
application/octet-stream

File Type Gallery

File Type includes icons for common document, image, audio, video, data, and archive formats.

pdf
doc
xls
ppt
csv
json
xml
html
txt
jpg
png
svg
mp3
wav
mp4
mov
mkv
webm
avi
zip