Typewriter

Text that appears character by character with a blinking cursor. Supports looping phrases, cursor styles, speeds, and colors.

This component requires softui.js for interactive behavior.

Default

Welcome to SoftUI, a neumorphic CSS library.

<p style="font-size:22px;font-weight:700;">
  <span class="sui-typewriter sui-typewriter-cursor" data-sui-typewriter>Welcome to SoftUI, a neumorphic CSS library.</span>
</p>

<!-- Types out the text content character by character -->
<!-- sui-typewriter-cursor adds the blinking cursor -->

Loop

I love

npm install

<p style="font-size:22px;font-weight:700;">
  I love
  <span class="sui-typewriter sui-typewriter-cursor"
    data-sui-typewriter
    data-words="building websites|writing CSS|creating components|open source"
    data-loop></span>
</p>

<!-- data-words: pipe-separated phrases to cycle through -->
<!-- data-loop: types, deletes, types next phrase, repeats -->

Cursor Styles

Line cursor:

Block cursor:

Underscore cursor:

<!-- Line cursor (default) -->
<span class="sui-typewriter sui-typewriter-cursor" data-sui-typewriter>...</span>

<!-- Block cursor -->
<span class="sui-typewriter sui-typewriter-cursor-block" data-sui-typewriter>...</span>

<!-- Underscore cursor -->
<span class="sui-typewriter sui-typewriter-cursor-underscore" data-sui-typewriter>...</span>

Speeds

Slow (120ms):

Default (80ms):

Fast (30ms):

<!-- Slow -->
<span class="sui-typewriter sui-typewriter-cursor" data-sui-typewriter data-speed="120">Slow text</span>

<!-- Default -->
<span class="sui-typewriter sui-typewriter-cursor" data-sui-typewriter>Default speed</span>

<!-- Fast -->
<span class="sui-typewriter sui-typewriter-cursor" data-sui-typewriter data-speed="30">Fast text</span>

<!-- data-speed: ms per character (default 80) -->
<!-- data-delete-speed: ms per character when deleting (default 40) -->
<!-- data-pause: ms to pause before deleting (default 1500) -->

With Colors

Deploy to

Status:

Error:

<!-- Primary -->
<span class="sui-typewriter sui-typewriter-cursor sui-typewriter-primary"
  data-sui-typewriter data-words="production|staging|preview" data-loop></span>

<!-- Success -->
<span class="sui-typewriter sui-typewriter-cursor-block sui-typewriter-success"
  data-sui-typewriter data-words="All systems operational"></span>

<!-- Danger -->
<span class="sui-typewriter sui-typewriter-cursor sui-typewriter-danger"
  data-sui-typewriter data-words="Connection refused|Timeout exceeded" data-loop></span>

<!-- Color classes: sui-typewriter-primary, success, danger, warning, info -->

Delete this item?

This action cannot be undone. This will permanently delete the item and remove all associated data.