Skip to content

SyMind/svelte-ink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Svelte Ink

Svelte for CLIs. Build and test your CLI output using components.

Install

Use create-svelte-ink-app to quickly scaffold a new Ink-based CLI.

npx create-svelte-ink-app

Usage

<script>
import { onDestroy } from 'svelte'

let counter = 0

const timer = setInterval(() => {
    counter += 1
}, 100)

onDestroy(() => clearInterval(timer))
</script>

<ink-text color="green">{counter} tests passed</ink-text>

Components

<ink-text>

This component can display text, and change its style to make it bold, underline, italic or strikethrough.

<ink-text color="green">I am green</ink-text>
<ink-text color="black" background-color="white">
    I am black on white
</ink-text>
<ink-text color="#ffffff">I am white</ink-text>
<ink-text bold>I am bold</ink-text>
<ink-text italic>I am italic</ink-text>
<ink-text underline>I am underline</ink-text>
<ink-text strikethrough>I am strikethrough</ink-text>
<ink-text inverse>I am inversed</ink-text>

Note: allows only text nodes and nested components inside of it. For example, component can't be used inside .

License

MIT

About

๐ŸŒˆ Svelte for interactive command-line apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published