vadimdemedes/ink-ui — 2.1k★ trên GitHub (TypeScript). 💄 Ink-redible command-line interfaces made easy
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Collection of customizable UI components for CLIs made with Ink.
Install
npm install @inkjs/ui
This assumes you've already set up Ink. The easiest way to get started is create-ink-app.
Components
Text input
Documentation
TextInput is used for entering any single-line input with an optional autocomplete.
import {TextInput} from '@inkjs/ui';
<TextInput
placeholder="Enter your name..."
onSubmit={name => {
// `name` contains user input
}}
/>;
Email input
Documentation
EmailInput is used for entering an email. After "@" character is entered, domain can be autocompleted from the list of most popular email providers.
import {EmailInput} from '@inkjs/ui';
<EmailInput
placeholder="Enter email..."
onSubmit={email => {
// `email` contains user input
}}
/>;
Password input
Documentation
PasswordInput is used for entering sensitive data, like passwords, API keys and so on. It works the same way as TextInput, except input value is masked and replaced with asterisks ("*").
import {PasswordInput} from '@inkjs/ui';
<PasswordInput
placeholder="Enter password..."
onSubmit={password => {
// `password` contains user input
}}
/>;
Confirm input
Documentation
ConfirmInput shows a common "Y/n" input to confirm or cancel an operation your CLI wants to perform.
StatusMessage can also be used to indicate a status, but when longer explanation of such status is required.
import {StatusMessage} from '@inkjs/ui';
<StatusMessage variant="success">
New version is deployed to production
</StatusMessage>
<StatusMessage variant="error">
Failed to deploy a new version of this app
</StatusMessage>
<StatusMessage variant="warning">
Health checks aren't configured
</StatusMessage>
<StatusMessage variant="info">
This version is already deployed
</StatusMessage>
Alert
Documentation
Alert is used to focus user's attention to important messages.
import {Alert} from '@inkjs/ui';
<Alert variant="success">
A new version of this CLI is available
</Alert>
<Alert variant="error">
Your license is expired
</Alert>
<Alert variant="warning">
Current version of this CLI has been deprecated
</Alert>
<Alert variant="info">
API won't be available tomorrow night
</Alert>
All component have their styles defined in a theme, which is accessible to components via React context. Ink UI ships with a default theme and it can be customized or replaced with a different theme altogether.
Let's get a quick look on how to customize a Spinner's component theme. Here's how it looks by default:
First, look up component's default theme, which will give an overview which parts does this component consist of. Documentation of each component includes a link to component's theme.ts file on top. In the case of Spinner, it's source/components/spinner/theme.ts.
This component theme hints that Spinner has 3 parts: container, frame and a label. So to customize the color of the spinner itself, we'd want to change the color prop returned from the frame function.
To customize the default theme, use extendTheme function and make that custom theme available to children components via ThemeProvider.
Since each field in styles object is a function, it can return different styles based on the props that were passed in or a state of a component.
Component themes can also include configuration for rendering a component in a config object, that's not related to styling. For example, UnorderedList specifies a marker, which is a character that's rendered before each list item.
Components shipped in Ink UI automatically read the necessary styles and configuration from a theme. However, if you're adding a new custom component and a theme for it, use useComponentTheme hook to access it.
vadimdemedes/ink-ui thuộc nhóm Frontend trên TopGit, cùng 7 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về vadimdemedes/ink-ui ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/vadimdemedes/ink-ui là nguồn chính thức.
vadimdemedes/ink-ui có bao nhiêu sao?
vadimdemedes/ink-ui có 2.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/vadimdemedes/ink-ui. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
vadimdemedes/ink-ui có phải mã nguồn mở không?
Có — vadimdemedes/ink-ui phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/vadimdemedes/ink-ui.
vadimdemedes/ink-ui có trang demo không?
Dự án có trang chủ ở https://term.ink/ui. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
vadimdemedes/ink-ui là gì?
vadimdemedes/ink-ui (vadimdemedes/ink-ui) là dự án TypeScript trên GitHub. Theo mô tả gốc: 💄 Ink-redible command-line interfaces made easy
vadimdemedes/ink-ui so với các dự án Frontend khác thế nào?
vadimdemedes/ink-ui được TopGit xếp vào nhóm Frontend, với 2.1k sao GitHub và viết bằng TypeScript. Xem trang chủ đề Frontend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về ink-ui?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về ink-ui.