Open fzdwx opened 2 years ago
项目地址:https://github.com/fzdwx/infinite
类别:Go
项目标题:用Golang开发的交互式命令行组件库。
项目描述: 它提供了一些常用的交互式组件,比如说progress,progress group,mulit select,input text,confirm等.同时也提供了一些更基础的组件,方便用户进行组合使用。
progress
progress group
mulit select
input text
confirm
亮点:
autocomplete
input
selection
示例代码 这个 一个multi select的代码案例
multi select
package main
import ( inf "github.com/fzdwx/infinite" "github.com/fzdwx/infinite/color" "github.com/fzdwx/infinite/components" "github.com/fzdwx/infinite/components/selection/multiselect" "github.com/fzdwx/infinite/style" )
func main() { input := components.NewInput() input.Prompt = "Filtering: " input.PromptStyle = style.New().Bold().Italic().Fg(color.LightBlue)
_, _ = inf.NewMultiSelect([]string{ "Buy carrots", "Buy celery", "Buy kohlrabi", "Buy computer", "Buy something", "Buy car", "Buy subway", }, multiselect.WithHintSymbol("x"), multiselect.WithUnHintSymbol("√"), multiselect.WithFilterInput(input), ).Display("select your items!")
}
- 截图: autocomplete: ![demo](https://user-images.githubusercontent.com/65269574/183641765-e8de7441-3c4e-4008-b2a9-b2ba556ddd72.gif) print ![demo](https://user-images.githubusercontent.com/65269574/184350545-01c52f90-77a1-42c3-9bb0-7c23b828799a.gif) multi select ![image](https://user-images.githubusercontent.com/65269574/183274216-d2a7af91-0581-4d13-b8c2-00b9aad5ef3a.gif) progress bar ![image](https://user-images.githubusercontent.com/65269574/183296585-b0a56827-d9d9-4258-ad32-266ada01b1ed.gif) confirm ![image](https://user-images.githubusercontent.com/65269574/183076452-5fa73013-42de-47df-97b4-7be743d074c1.gif)
推荐项目
项目地址:https://github.com/fzdwx/infinite
类别:Go
项目标题:用Golang开发的交互式命令行组件库。
项目描述: 它提供了一些常用的交互式组件,比如说
progress
,progress group
,mulit select
,input text
,confirm
等.同时也提供了一些更基础的组件,方便用户进行组合使用。亮点:
autocomplete
由input
和selection
组成selection
通过嵌入input
来实现过滤功能.示例代码 这个 一个
multi select
的代码案例import ( inf "github.com/fzdwx/infinite" "github.com/fzdwx/infinite/color" "github.com/fzdwx/infinite/components" "github.com/fzdwx/infinite/components/selection/multiselect" "github.com/fzdwx/infinite/style" )
func main() { input := components.NewInput() input.Prompt = "Filtering: " input.PromptStyle = style.New().Bold().Italic().Fg(color.LightBlue)
}