@@ -23,6 +23,7 @@ promkit = "0.4.4"
2323 - [ Readline] ( #readline )
2424 - [ Confirm] ( #confirm )
2525 - [ Password] ( #password )
26+ - [ Form] ( #form )
2627 - [ Listbox] ( #listbox )
2728 - [ QuerySelector] ( #queryselector )
2829 - [ Checkbox] ( #checkbox )
@@ -147,6 +148,72 @@ fn main() -> Result {
147148
148149![ password] ( https://github.com/ynqa/promkit/assets/6745370/396356ef-47de-44bc-a8d4-d03c7ac66a2f )
149150
151+ ### Form
152+
153+ <details >
154+ <summary >Command</summary >
155+
156+ ``` bash
157+ cargo run --example form
158+ ```
159+
160+ </details >
161+
162+ <details >
163+ <summary >Code</summary >
164+
165+ ``` rust
166+ use promkit :: {crossterm :: style :: Color , preset :: form :: Form , style :: StyleBuilder , text_editor};
167+
168+ fn main () -> anyhow :: Result <()> {
169+ let mut p = Form :: new ([
170+ text_editor :: State {
171+ texteditor : Default :: default (),
172+ history : Default :: default (),
173+ prefix : String :: from (" ❯❯ " ),
174+ mask : Default :: default (),
175+ prefix_style : StyleBuilder :: new (). fgc (Color :: DarkRed ). build (),
176+ active_char_style : StyleBuilder :: new (). bgc (Color :: DarkCyan ). build (),
177+ inactive_char_style : StyleBuilder :: new (). build (),
178+ edit_mode : Default :: default (),
179+ word_break_chars : Default :: default (),
180+ lines : Default :: default (),
181+ },
182+ text_editor :: State {
183+ texteditor : Default :: default (),
184+ history : Default :: default (),
185+ prefix : String :: from (" ❯❯ " ),
186+ mask : Default :: default (),
187+ prefix_style : StyleBuilder :: new (). fgc (Color :: DarkGreen ). build (),
188+ active_char_style : StyleBuilder :: new (). bgc (Color :: DarkCyan ). build (),
189+ inactive_char_style : StyleBuilder :: new (). build (),
190+ edit_mode : Default :: default (),
191+ word_break_chars : Default :: default (),
192+ lines : Default :: default (),
193+ },
194+ text_editor :: State {
195+ texteditor : Default :: default (),
196+ history : Default :: default (),
197+ prefix : String :: from (" ❯❯ " ),
198+ mask : Default :: default (),
199+ prefix_style : StyleBuilder :: new (). fgc (Color :: DarkBlue ). build (),
200+ active_char_style : StyleBuilder :: new (). bgc (Color :: DarkCyan ). build (),
201+ inactive_char_style : StyleBuilder :: new (). build (),
202+ edit_mode : Default :: default (),
203+ word_break_chars : Default :: default (),
204+ lines : Default :: default (),
205+ },
206+ ])
207+ . prompt ()? ;
208+ println! (" result: {:?}" , p . run ()? );
209+ Ok (())
210+ }
211+ ```
212+
213+ </details >
214+
215+ ![ form] ( https://github.com/ynqa/promkit/assets/6745370/c3dc88a7-d0f0-42f4-90b8-bc4d2e23e36d )
216+
150217### Listbox
151218
152219<details >
0 commit comments