All Projects → haensl → preact-component-console

haensl / preact-component-console

Licence: MIT License
A console emulator for preact.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to preact-component-console

preact-motion
A fork of React-Motion to be used with Preact
Stars: ✭ 28 (-3.45%)
Mutual labels:  preact, preact-components
preact-perf-profiler
A HOC to enable measuring rendering performance for Preact components
Stars: ✭ 18 (-37.93%)
Mutual labels:  preact, preact-components
preact-custom-scrollbars
⇅ Preact scrollbars component
Stars: ✭ 20 (-31.03%)
Mutual labels:  preact, preact-components
preact-route-async
Easy asynchronous loading for your router components. For 440B.
Stars: ✭ 36 (+24.14%)
Mutual labels:  preact, preact-components
preact-token-input
🔖 A text field that tokenizes input, for things like tags.
Stars: ✭ 57 (+96.55%)
Mutual labels:  preact, preact-components
preact-mdc
material design components for preact using material-components-web sass styles (for live demo click the link below)
Stars: ✭ 23 (-20.69%)
Mutual labels:  preact, preact-components
preact-bind-group
Preact Component to Group Form fields onChange Events to a single Callback
Stars: ✭ 25 (-13.79%)
Mutual labels:  preact, preact-components
fpga-virtual-console
VT220-compatible console on Cyclone IV EP4CE55F23I7
Stars: ✭ 33 (+13.79%)
Mutual labels:  console, terminal-emulator
preact-views
📺 Named views for Preact, with easy-as-pie linking between them.
Stars: ✭ 39 (+34.48%)
Mutual labels:  preact, preact-components
LinuxLikeConsole
Linux Like Console written in gdscript for Godot (Game Engine)
Stars: ✭ 26 (-10.34%)
Mutual labels:  console
pretty-routes
Display your Laravel routes in the console, but make it pretty. 😎
Stars: ✭ 627 (+2062.07%)
Mutual labels:  console
TypeLighterJS-Typewriter
Take a stride into the world of dynamic and appealing typewriters. You can be sure that you will never even think of looking back.
Stars: ✭ 266 (+817.24%)
Mutual labels:  typewriter
Yuna
Yuan企业通用后台,快速实现微后台架构
Stars: ✭ 19 (-34.48%)
Mutual labels:  console
terminalpp
Minimalist, fast, cross-platform terminal emulator.
Stars: ✭ 37 (+27.59%)
Mutual labels:  terminal-emulator
unist-util-inspect
utility to inspect nodes
Stars: ✭ 16 (-44.83%)
Mutual labels:  console
RecoverPy
🙈 Interactively find and recover deleted or 👉 overwritten 👈 files from your terminal
Stars: ✭ 189 (+551.72%)
Mutual labels:  console
theodorusclarence.com
💠 Personal website and blog made using Next.js, TypeScript, Tailwind CSS, MDX Bundler, FaunaDB, and Preact.
Stars: ✭ 205 (+606.9%)
Mutual labels:  preact
preact-server-renderer
Server side rendering of preact components
Stars: ✭ 66 (+127.59%)
Mutual labels:  preact
WeConsole
功能全面、界面与体验对标 Chrome devtools 的可定制化的小程序开发调试面板
Stars: ✭ 137 (+372.41%)
Mutual labels:  console
contour
Modern C++ Terminal Emulator
Stars: ✭ 761 (+2524.14%)
Mutual labels:  console

preact-component-console

Console emulator preact component. Emulates realistic typing via dynamic char-typing delays.

NPM

npm version Build Status

Intro

Quick Start

  1. Install the package

    via NPM

    npm i --save preact-component-console

    via yarn

    yarn add preact-component-console
  2. Use the component

import Console from 'preact-component-console';

// ...

  render() {
    <Console lines={[
      'Hi there!',
      'How are you today?'
    ]} />
  }

Options

lines Array<string> | string

The lines to write.

Example

<Console
  lines={[
    'Hi there!',
    'How are you today?'
  ]}
/>

console Object

Set options on the console component.

Signature

{
  append: false, // whether to append lines
  classes: {
    element: 'console' // class to set on the root element
  },
  typing: {
    char: { // options concerning typing of individual characters
      avgMs: 150, // average duration for typing a char in milliseconds
      deviation: 0.3, // average deviation to apply to avgMs
      minMs: 50, // minimum duration for typing a char in milliseconds
      maxMs: Infinity // maximum duration for typing a char in milliseconds
    },
    line: { // options concerning typing of a line
      delay: { // options concerning the delay between lines
        avgMs: 1000, // average delay between to lines in milliseconds
        deviation: 0.5, // average deviation to apply to avgMs
        minMs: 500, // minimum delay between to lines in milliseconds
        maxMs: 1500 // maximum delay between to lines in milliseconds
      }
    }
  }
}

Example

<Console
  console={{
    classes: {
      element: 'my-console' // set console component class to 'my-console'
    }
    typing={
      char: {
        avgMs: 200 // set average duration for typing a char to 200ms
      }
    }
  }}
  lines={[
    'Hi there!',
    'How are you today?'
  ]}
/>

line Object

Set options for the line component(s).

Signature

{
  classes: {
    element: 'console-line', // class to set on a line component
    content: 'console-line-content' // class to set on the line's text content
  }
}

Example

<Console
  lines={[
    'Hi there!',
    'How are you today?'
  ]}
  line={{
    classes: {
      element: 'line-text' // set the css class name for line text to 'line-text'
    }
  }}
/>

ps1 Object

Set options for the PS1 component.

Signature

{
  classes: {
    element: 'console-ps1', // class to set on a ps1 component
  },
  content: '$' // string to display as ps1
}

Example

<Console
  lines={[
    'Hi there!',
    'How are you today?'
  ]}
  ps1={{
    content: "∆" // set the ps1 string to ∆
  }}
/>

cursor Object

Set options for the cursor.

Signature

{
  classes: {
    blink: 'console-cursor--blink', // class to set on the cursor component when visible (in addition to the class set in element)
    element: 'console-cursor', // class to set on a cursor component
    write: 'console-cursor--write' // class to set on the cursor component while writing (in additon to the class set in element)
    
  },
  intervalMs: 400 // duration between blink cycles in milliseconds
}

Example

<Console
  lines={[
    'Hi there!',
    'How are you today?'
  ]}
  cursor={{
    intervalMs: 250 // set interval for cursor blinking to 250ms
  }}
/>

Changelog

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].