Skip to content
On this page

Components

Terminal

The terminal is the container of each line. You can specify properties on the terminal that will be used as default values for it's children.

The following props are available:

NameTypeDefaultDescription
startDelaynumber600Delay before animation, in ms.
typeDelaynumber90Delay between each typed character, in ms.
lineDelaynumber1500Delay between each line, in ms.
progressLengthnumber40Number of characters displayed as progress bar.
progressCharstring'█'Character to use for progress bar.
progressPercentnumber100Max percent of progress.
progressDelaynumber90Delay between each progress character, in ms.
spinnerTypestringdotsType of each spinner, defaults to dots.
spinnerFrameDelaynumber80Delay between each spinner frame, in ms.
spinnerDurationnumber1.5Seconds to wait before finishing each spinner's animation.
cursorstring'▋'Character to use for cursor.
lazybooleanfalseOnly start the animation when the terminal enters the viewport.
forwardButtonbooleanfalseWhether to a show the fast forward button.
restartButtonbooleanfalseWhether to a show the restart button.

Emitted events:

NameArgumentDescription
startnoneEmitted only once, when the terminal first starts it's animation.
before-new-lineHTMLElementEmits the next line's HTML Element before it's shown.
fast-forwardnoneEmitted when the user clicks on the fast forward button.
finishnoneEmitted when the terminal finished it's animation.
restartnoneEmitted when the user clicks on the restart button. Note: this will not trigger a start event afterwards.

Text

Simple output, no typing.

Props: lineDelay

Example:

html
<v-termynal>
  <vt-text>Hello there!</vt-text>
</v-termynal>

Input

Simple prompt with animated user input and cursor.

Props: lineDelay, typeDelay, prompt

The prompt specifies the characters that are displayed before each line, for example, to indicate command line inputs or interpreters (like >>> for Python). By default, Termynal displays a $ before each user input line.

Example:

html
<v-termynal>
  <vt-input>the default input</vt-input>
  <vt-input prompt=">>>">python prompt</vt-input>
  <vt-input prompt="(.env)">custom env prompt</vt-input>
</v-termynal>

Progress

Animated progress bar.

Props: lineDelay, progressLength, progressChar, progressPercent, progressDelay, prefix

Example:

html
<v-termynal>
  <vt-progress />
  <vt-progress :progress-length="45" progress-char="." />
  <vt-progress :progress-percent="69" />
  <vt-progress prefix="Calculating:" :progress-length="26" />
</v-termynal>

Spinner since 1.1.0

Animated spinner that shows through a given amount of time.

See every type of spinner at the examples page.

props: type, frameDelay, duration, prefix

Example:

html
<v-termynal>
  <vt-spinner />
  <vt-spinner type="aesthetic" />
  <vt-spinner type="aesthetic" prefix="Installing" />
</v-termynal>