<text-view> component documentation

Renders a Text object.

The <text-view> component displays a text. Text data type, together with basic metadata and an optional search interface.

Include a <text-view> as follows:


    <text-view></text-view>
  

Specifying a source text in HTML with the src attribute

The contents of a JSON file containing data in the Text format may be set as the content of a <text-view> component as follows:


      <text-view src="some-text.json"></text-view>
    
Demo of <text-view> with src attribute set.

Loading a source text from a file

A Text object may also be loaded dynamically. In the example below, a <input type=file> element has been set up to load the <text-view> when a user selects a file from their file system.

Demo of <text-view> with src attribute set.

Try loading a different *-text.json file here: