Component

w1c-source-viewer

w1c-source-viewer is the full gedit-style shell for source/code documents. Use w1c-json-viewer when you only need an embeddable JSON pane.

import '@w1c/components/source-viewer';
import '@w1c/components/toolbar';
import '@w1c/components/button';
import '@w1c/components/divider';
import '@w1c/components/statusbar';
<w1c-source-viewer filename="record.json" text='{"status":"ready"}' line-numbers>
	<w1c-toolbar slot="toolbar">
		<w1c-button>Copy</w1c-button>
		<w1c-button>Wrap</w1c-button>
		<w1c-divider orientation="vertical"></w1c-divider>
		<w1c-button>Save</w1c-button>
	</w1c-toolbar>
	<w1c-statusbar slot="statusbar">record.json - UTF-8</w1c-statusbar>
</w1c-source-viewer>

API

  • label: accessible group label.
  • filename: default pathbar text.
  • text: source text to render.
  • line-numbers: shows the gutter.

Slots

  • toolbar
  • pathbar
  • default source content, used when text is empty
  • statusbar

Parts

  • chrome
  • toolbar
  • pathbar
  • workspace
  • gutter
  • code
  • statusbar