TIFY –
A slim and mobile-friendly IIIF document viewer

Demo

Loading

Sample Documents

Core Features

  • Lightweight – only 129 kB (gzipped)
  • Fast – also with very large manifests
  • Easy to embed and highly configurable
  • Fully responsive and accessible
  • State can be reflected in bookmarkable URL

Usage examples

Getting Started

TIFY is a slim and mobile-friendly IIIF document viewer built with Vue.js. It supports IIIF Presentation API and Image API version 2 and 3.

Embedding TIFY

TIFY is available as an npm package:

npm install tify

Embed TIFY into your website in three easy steps:

  1. Include both the JavaScript and the stylesheet.

    • Either download TIFY and copy the contents of the dist directory to your server:

      <script src="tify.js?v0.33.0"></script>
      <link rel="stylesheet" href="tify.css?v0.33.0">
      

      To avoid issues with browser caching, add a query parameter with the current version, e.g. ?v0.33.0.

    • Or use jsDelivr:

      <script src="https://cdn.jsdelivr.net/npm/tify@0.33.0/dist/tify.js"></script>
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tify@0.33.0/dist/tify.css">
      
    • Or import TIFY into your web application:

      import 'tify'
      import 'tify/dist/tify.css'
      
  2. Add an HTML block element with an id and set its height.

    <div id="tify" style="height: 640px"></div>
    
  3. Create a TIFY instance.

    <script>
    new Tify({
      container: '#tify',
      manifestUrl: 'https://example.org/iiif-manifest.json',
    })
    </script>
    

Many aspects of the theme can be modified with SCSS variables or CSS custom properties, allowing you to easily adapt TIFY’s appearance to your website. See the theme settings file for all available variables.

Upgrading

If you are are upgrading from any previous version, have a look at the upgrading guidelines.

Configuration

TIFY takes an options object as its only parameter. While optional, you usually want to set container and manifestUrl.

See options for a documentation of all available options.

An example with most options set to non-default values:

new Tify({
  container: '#tify',
  language: 'de',
  manifestUrl: 'https://example.org/iiif-manifest.json',
  pageLabelFormat: 'P (L)',
  pages: [2, 3],
  pan: { x: .45, y: .6 },
  translationsDirUrl: '/translations/tify',
  urlQueryKey: 'tify',
  urlQueryParams: ['pages'],
  view: '',
  viewer: {
    immediateRender: false,
  },
  zoom: 1.2,
})

API

TIFY provides an API for controlling most of its features, see API documentation.

Options

  • annotationId

    Type
    string or null
    Default
    null

    The ID of the annotation to highlight when the fulltext view is active. Only has effect for manifests with annotations.

  • annotationsVisible

    Type
    boolean or null
    Default
    null

    When the fulltext view is active (or just the scan view on small screens), TIFY displays clickable annotation overlays on the scan, which are linked to their corresponding fulltext section. Set to false to hide overlays by default. Annotation overlays can always be toggled by the user. Only has effect for manifests with annotations.

  • breakpoints

    Type
    object
    Default
    { tiny: 359, small: 719, medium: 959, large: 1199 }

    Breakpoints used for custom media queries, depending on TIFY’s container size instead of the viewport.

  • childManifestAutoloaded

    Type
    boolean
    Default
    true

    If the manifest set by manifestUrl is a collection (@type is sc:Collection) and childManifestUrl is not set, automatically load the first manifest in the collection. This only works for collections with manifests on the first level; when the collection only contains other collections and childManifestUrl is not set, only the collection view is shown until the user selects a child manifest to load.

  • childManifestUrl

    Type
    string or null
    Default
    null

    If the manifest set by manifestUrl is a collection (@type is sc:Collection), additionally load another IIIF manifest, whose @type must be sc:Manifest. Note that TIFY does not check if this additional manifest is actually part of the collection.

  • container

    Type
    string or HTMLElement or null
    Default
    null

    The HTML element into which TIFY is mounted. If set to null, TIFY is not mounted at all until mount is called (see docs/api.md).

  • contentStateEnabled

    Type
    boolean
    Default
    false

    If enabled, the manifest URL can be set via the iiif-content URL query parameter, thus supporting the bare minimum of the IIIF Content State API. This query is only evaluated if manifestUrl is not set.

  • fallbackLanguage

    Type
    string
    Default
    'en'

    The language to be used for strings from the IIIF manifest that are not available in the current language. If no value matches language or fallbackLanguage, the first available language is displayed.

  • filters

    Type
    object
    Default
    {}

    Sets the initial image filters. Available properties are 'brightness', 'contrast' (both a floating-point number between 0.5 and 2) and 'saturation' (floating-point number between 0 and 3), all optional.

  • language

    Type
    string
    Default
    'en'

    The interface language, matching the translation filename without extension. See which translations are available at https://github.com/tify-iiif-viewer/tify/tree/main/dist/translations or add your own.

  • manifestUrl

    Type
    string or null
    Default
    null

    The URL of the IIIF manifest to load.

  • optionsResetOnPageChange

    Type
    Array.<string>
    Default
    [ 'pan' ]

    Viewer options that are reset on page change. Allowed array values are 'filters', 'pan', 'rotation' and 'zoom'.

  • pageLabelFormat

    Type
    string
    Default
    `P${String.fromCharCode(160)/* &nbsp; */}· L`

    Defines how page labels are displayed in the page selector and in the thumbnails view. The placeholder P is replaced by the page number (consecutive numbers starting at 1) while L is replaced by the page label, which can be any string, defined by the manifest. If the page label is missing, only the page number is displayed, regardless of the format.

  • pages

    Type
    Array.<number> or null
    Default
    null

    The page(s) to display initially. If null, the initial page is determined by the manifest’s startCanvas, and if that is not set either, the first page is displayed. Page numbers start at 1.

  • pan

    Type
    object
    Default
    {}

    Sets the initial pan. The object has two optional properties x and y, both floating-point numbers. The higher the value, the more to the left respectively top the image is positioned. By default, the image is centered within the container.

  • rotation

    Type
    number or null
    Default
    null

    The initial rotation of the scan in degrees. Should be a multiple of 90.

  • translationsDirUrl

    Type
    string or null
    Default
    null

    The URL of the directory where TIFY finds its translations, without a trailing /. If not set, TIFY tries to determine this URL automatically from its <script> element, but this may not work depending on how TIFY is loaded.

  • urlQueryKey

    Type
    string or null
    Default
    null

    If set, parameters are read from the URL query and any changes are reflected, using the key provided. This works with multiple concurrent instances, but each instance must use a unique key. Note that when urlQueryKey is set, all options defined by urlQueryParams can be overridden by changing the URL in the browser’s address bar. Only use characters A…Z a…z 0…9 - _. While this functionality can be used together with iiif-content (see contentStateEnabled), it does not yet conform to the IIIF Content State API.

  • urlQueryParams

    Type
    Array.<string>
    Default
    [ 'annotationId', 'annotationsVisible', 'childManifestUrl', 'filters', 'pages', 'pan', 'rotation', 'view', 'zoom' ]

    The parameter keys to be read from and stored in the URL query. Only has effect if urlQueryKey is set, in which case parameters read from the URL override options of the same name.

  • view

    Type
    string or null
    Default
    null

    The initially displayed view (panel); fulltext, thumbnails, toc, info, help, or null to display (only) the scan. On large screens, the scan is always shown next to the selected view.

  • viewer

    Type
    object
    Default
    {}

    An object with options for OpenSeadragon, TIFY’s image rendering component. See its documentation at https://openseadragon.github.io/docs/OpenSeadragon.html#.Options for all available options.

  • zoom

    Type
    number or null
    Default
    null

    Sets the initial zoom level. The higher the number, the deeper the zoom. By default, zoom is set automatically so that the full image is visible.