maticzav / Ink Autocomplete
🧠 An autocomplete component for Ink.
Stars: ✭ 71
Programming Languages
javascript
184084 projects - #8 most used programming language
Labels
Projects that are alternatives of or similar to Ink Autocomplete
Picocli
Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.
Stars: ✭ 3,286 (+4528.17%)
Mutual labels: cli, autocomplete
Graphqurl
curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.
Stars: ✭ 3,012 (+4142.25%)
Mutual labels: cli, autocomplete
Vcli
Vertica CLI with auto-completion and syntax highlighting
Stars: ✭ 75 (+5.63%)
Mutual labels: cli, autocomplete
Crossline
A small, self-contained, zero-config, MIT licensed, cross-platform, readline and libedit replacement.
Stars: ✭ 53 (-25.35%)
Mutual labels: cli, autocomplete
Caporal.js
A full-featured framework for building command line applications (cli) with node.js
Stars: ✭ 3,279 (+4518.31%)
Mutual labels: cli, autocomplete
Gql
Very simple CLI for many GraphQL schemas in the cloud. Provides autocompletion for GraphQL queries
Stars: ✭ 101 (+42.25%)
Mutual labels: cli, autocomplete
Autocomplete
Autocomplete for terminals on MacOS
Stars: ✭ 569 (+701.41%)
Mutual labels: cli, autocomplete
Influx Prompt
An interactive command-line InfluxDB cli with auto completion.
Stars: ✭ 42 (-40.85%)
Mutual labels: cli, autocomplete
Http Prompt
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
Stars: ✭ 8,329 (+11630.99%)
Mutual labels: cli, autocomplete
Pyinquirer
A Python module for common interactive command line user interfaces
Stars: ✭ 1,151 (+1521.13%)
Mutual labels: cli
Kju
Kju — Improved waiting time for the adidas.com splash page ❯❯❯_
Stars: ✭ 68 (-4.23%)
Mutual labels: cli
Hopp Doc Gen
📔 API documentation generator CLI for https://hoppscotch.io
Stars: ✭ 70 (-1.41%)
Mutual labels: cli
Pillager
Pillage filesystems for sensitive information with Go.
Stars: ✭ 64 (-9.86%)
Mutual labels: cli
Tent
Podman (https://podman.io/) based development-only dependency manager for Linux
Stars: ✭ 69 (-2.82%)
Mutual labels: cli
Toc
🚩 TOC, zero configuration table of content generator for Markdown files, create table of contents from any Markdown file with ease.
Stars: ✭ 66 (-7.04%)
Mutual labels: cli
Node Installed Check
Checks that all dependencies in your package.json have supported versions installed and complies with your specified node engine version range
Stars: ✭ 67 (-5.63%)
Mutual labels: cli
Supremedropbot
A supreme web bot, written in python, to grab a list of specified products, and checkout before they sell out!
Stars: ✭ 66 (-7.04%)
Mutual labels: autocomplete
ink-autocomplete
Autocomplete component for Ink.
Install
$ npm install ink-autocomplete
Usage
Use arrows to navigate up and down and press enter to submit.
import {h, render, Component, Text} from 'ink'
import AutoComplete from 'ink-autocomplete'
// Demo
class Demo extends Component {
constructor() {
super()
this.state = {
value: '',
selected: null
}
this.handleChange = this.handleChange.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
}
render(props, {value, selected}) {
const countries = [
{
label: 'United Kingdom',
value: {country: 'United Kingdom', capital: 'London'}
},
{
label: 'United States',
value: {country: 'United States', capital: 'Washington DC'}
},
{
label: 'United Arab Emirates',
value: {country: 'United Arab Emirates', capital: 'Abu Dhabi'}
}
]
return (
<div>
<Text green>{'Enter your country: '}</Text>
<AutoComplete
value={value}
placeholder={'Type a country'}
items={countries}
onChange={this.handleChange}
onSubmit={this.handleSubmit}
/>
{ selected && (
<span>
<Text>The capital of your country is: </Text>
<Text red>{selected.value.capital}</Text>
</span>
)}
</div>
)
}
handleChange(value) {
this.setState({
value,
selected: null
})
}
handleSubmit(selected) {
this.setState({
selected
})
}
}
// Ink
render(<Demo/>)
Props
string
value Value of the input.
string
placeholder String displayed when the input is empty.
array<item>
items A list of all items. Each item must include
label
andvalue
property.
string => item => bool
getMatch Called to determine which items satisfy the input.
function string => ()
onChange Called each time input is changed.
function (item) => ()
onSubmit Called once suggestion is selected.
Component
indicatorComponent Custom component to override the default item component.
Component
itemComponent Custom component to override the default item component.
License
MIT © Matic Zavadlal
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].