{"id":33926988,"url":"https://github.com/sorinirimies/tui-checkbox","last_synced_at":"2026-04-02T14:03:42.673Z","repository":{"id":320455647,"uuid":"1081352207","full_name":"sorinirimies/tui-checkbox","owner":"sorinirimies","description":"A terminal Checkbox component designed for ratatui interoperability https://github.com/ratatui/ratatui","archived":false,"fork":false,"pushed_at":"2026-02-20T17:57:41.000Z","size":403,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-23T01:43:40.027Z","etag":null,"topics":["clap","clap-rs","cli","cli-rs","ratatui","ratatui-rs","tui"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sorinirimies.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-22T16:58:27.000Z","updated_at":"2026-02-20T17:57:43.000Z","dependencies_parsed_at":"2025-10-23T23:17:22.449Z","dependency_job_id":"a4b16bb0-8def-4e43-8a3e-f1e670a18e37","html_url":"https://github.com/sorinirimies/tui-checkbox","commit_stats":null,"previous_names":["sorinirimies/tui-checkbox"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/sorinirimies/tui-checkbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorinirimies%2Ftui-checkbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorinirimies%2Ftui-checkbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorinirimies%2Ftui-checkbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorinirimies%2Ftui-checkbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorinirimies","download_url":"https://codeload.github.com/sorinirimies/tui-checkbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorinirimies%2Ftui-checkbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clap","clap-rs","cli","cli-rs","ratatui","ratatui-rs","tui"],"created_at":"2025-12-12T10:39:17.686Z","updated_at":"2026-04-02T14:03:42.664Z","avatar_url":"https://github.com/sorinirimies.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tui-checkbox\n\n[![Crates.io](https://img.shields.io/crates/v/tui-checkbox)](https://crates.io/crates/tui-checkbox)\n[![Documentation](https://docs.rs/tui-checkbox/badge.svg)](https://docs.rs/tui-checkbox)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Release](https://github.com/sorinirimies/tui-checkbox/actions/workflows/release.yml/badge.svg)](https://github.com/sorinirimies/tui-checkbox/actions/workflows/release.yml)\n[![CI](https://github.com/sorinirimies/tui-checkbox/actions/workflows/ci.yml/badge.svg)](https://github.com/sorinirimies/tui-checkbox/actions/workflows/ci.yml)\n\nA customizable checkbox widget for [Ratatui](https://github.com/ratatui/ratatui) TUI applications.\n\n## Preview\n![checkbox](https://github.com/user-attachments/assets/51e2f5f7-4546-4809-a50a-e754f9ecd866)\n\n## Features\n\n- ☑️ Simple checkbox with label\n- 🎨 Customizable styling for checkbox and label separately\n- 🔤 Custom symbols (unicode, emoji, ASCII)\n- 📦 Block wrapper - **optional**\n- 📍 Label positioning (right, left, top, bottom) - **optional**\n- ↔️ Horizontal \u0026 vertical alignment - **optional**\n- 📏 Width constraints (min/max) - **optional**\n- 📝 Text wrapping for long labels - **optional**\n- ⚡ Zero-cost abstractions\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\ntui-checkbox = \"0.2.0\"\nratatui = \"0.29\"\n```\n\nOr install with cargo:\n\n```bash\ncargo add tui-checkbox\n```\n\n## Quick Start\n\n```rust\nuse ratatui::style::{Color, Style, Modifier};\nuse tui_checkbox::Checkbox;\n\n// Basic checkbox\nlet checkbox = Checkbox::new(\"Enable feature\", true);\n\n// Styled checkbox\nlet checkbox = Checkbox::new(\"Enable feature\", true)\n    .style(Style::default().fg(Color::White))\n    .checkbox_style(Style::default().fg(Color::Green).add_modifier(Modifier::BOLD))\n    .label_style(Style::default().fg(Color::Gray));\n\n// Custom symbols\nlet checkbox = Checkbox::new(\"Task\", false)\n    .checked_symbol(\"✅ \")\n    .unchecked_symbol(\"⬜ \");\n\n// With a block\nuse ratatui::widgets::Block;\n\nlet checkbox = Checkbox::new(\"Accept terms\", false)\n    .block(Block::bordered().title(\"Settings\"));\n```\n\n## Label Positioning\n\nControl where the label appears relative to the checkbox symbol.\n\n\u003e **Note**: All layout features are **optional**! The checkbox works perfectly with sensible defaults. Only use these methods when you need to customize the layout.\n\n```rust\nuse tui_checkbox::{Checkbox, LabelPosition};\n\n// Simple checkbox - works great with defaults!\nCheckbox::new(\"Enable feature\", true);\n\n// Label on the left (optional customization)\nCheckbox::new(\"Enable feature\", true)\n    .label_position(LabelPosition::Left);\n\n// Label on top (optional customization)\nCheckbox::new(\"Enable feature\", false)\n    .label_position(LabelPosition::Top);\n\n// Label on bottom (optional customization)\nCheckbox::new(\"Enable feature\", false)\n    .label_position(LabelPosition::Bottom);\n```\n\n**Defaults**: Label on the right (standard checkbox style)\n\n### Alignment (Optional)\n\nAlign the checkbox content within its area. Only needed for specific layouts.\n\n```rust\nuse tui_checkbox::{Checkbox, HorizontalAlignment, VerticalAlignment};\n\n// Horizontal alignment (optional)\nCheckbox::new(\"Centered\", true)\n    .horizontal_alignment(HorizontalAlignment::Center);\n\nCheckbox::new(\"Right\", true)\n    .horizontal_alignment(HorizontalAlignment::Right);\n\n// Vertical alignment (optional)\nCheckbox::new(\"Middle\", false)\n    .vertical_alignment(VerticalAlignment::Center);\n\nCheckbox::new(\"Bottom\", false)\n    .vertical_alignment(VerticalAlignment::Bottom);\n```\n\n**Defaults**: Left and top aligned\n\n### Width Constraints \u0026 Text Wrapping (Optional)\n\nSet minimum and maximum width constraints, and enable text wrapping when needed.\n\n```rust\n// Minimum width (optional)\nCheckbox::new(\"Small label\", true)\n    .min_width(30);\n\n// Maximum width (optional)\nCheckbox::new(\"This is a very long label that will be constrained\", false)\n    .max_width(25);\n\n// Text wrapping (optional - for long labels)\nCheckbox::new(\"This is a very long label that demonstrates text wrapping\", true)\n    .wrap_label(true)\n    .max_width(30);\n```\n\n**Defaults**: No width constraints, no wrapping\n\n## Layout Examples\n\n### Label Position Example\n\nSee all four label positions in action:\n\n```bash\ncargo run --example checkbox_label_position\n```\n\nThis demonstrates: right, left, top, and bottom label positions.\n\n![Label Position Demo](examples/vhs/checkbox_label_position.gif)\n\n### Alignment Example\n\nSee horizontal and vertical alignment:\n\n```bash\ncargo run --example checkbox_alignment\n```\n\nThis demonstrates:\n- Horizontal alignment: left, center, right\n- Vertical alignment: top, center, bottom\n\n![Alignment Demo](examples/vhs/checkbox_alignment_demo.gif)\n\n### Width \u0026 Wrapping Example\n\nSee width constraints and text wrapping:\n\n```bash\ncargo run --example checkbox_width_wrapping\n```\n\nThis demonstrates:\n- Minimum and maximum width constraints\n- Text wrapping (enabled vs disabled)\n- Combined features\n\n![Width \u0026 Wrapping Demo](examples/vhs/checkbox_width_wrapping.gif)\n\n## Examples\n\nRun the included example with two modes:\n\n```bash\ncargo run --example checkbox\n```\n\n### Interactive Mode (Default)\n\nNavigate and toggle checkboxes with your keyboard:\n- **↑/↓** or **k/j** - Navigate between checkboxes\n- **Space** - Toggle checkbox state\n- **Tab** - Switch to API Showcase mode\n- **q** or **Esc** - Quit\n\nThe interactive mode demonstrates:\n- Basic checkbox with default styling\n- Styled checkboxes with colors (Info, Warning, Error)\n- Emoji and Unicode symbols (✅, ●, ◆)\n- Custom ASCII symbols ([X], [*], [+]/[-], (X)/(O))\n\n### API Showcase Mode\n\nPress **Tab** to switch to the API showcase view, which displays all available features:\n- All core API methods (`new()`, `default()`, `label()`, `checked()`)\n- All styling methods (`style()`, `checkbox_style()`, `label_style()`)\n- Symbol customization (`checked_symbol()`, `unchecked_symbol()`)\n- All predefined symbols from the `symbols` module\n- Advanced usage (blocks, Styled trait, method chaining)\n\n## Styling\n\nThe widget supports multiple styling options:\n\n- **`style()`**: Sets the base style for the entire widget\n- **`checkbox_style()`**: Sets the style specifically for the checkbox symbol\n- **`label_style()`**: Sets the style specifically for the label text\n\nStyles are applied in order: base style, then specific styles override it.\n\n## Custom Symbols\n\nThe widget comes with default Unicode checkbox symbols (☐ and ☑), but you can use any symbols:\n\n```rust\n// Emoji style\nCheckbox::new(\"Task\", true)\n    .checked_symbol(\"✅ \")\n    .unchecked_symbol(\"⬜ \");\n\n// ASCII style\nCheckbox::new(\"Task\", false)\n    .checked_symbol(\"[X]\")\n    .unchecked_symbol(\"[ ]\");\n\n// Circle style\nCheckbox::new(\"Task\", true)\n    .checked_symbol(\"● \")\n    .unchecked_symbol(\"○ \");\n```\n\n## Predefined Symbols\n\nThe `symbols` module provides some common checkbox symbols:\n\n- `symbols::CHECKED` - ☑\n- `symbols::UNCHECKED` - ☐\n- `symbols::CHECKED_X` - [X]\n- `symbols::UNCHECKED_SPACE` - [ ]\n- `symbols::CHECKED_ASTERISK` - [*]\n- `symbols::CHECKED_PLUS` - [+]\n- `symbols::UNCHECKED_MINUS` - [-]\n- `symbols::CHECKED_PARENTHESIS_X` - (X)\n- `symbols::UNCHECKED_PARENTHESIS_O` - (O)\n\n## Development\n\n### Prerequisites\n\n- Rust 1.74.0 or later\n- [just](https://github.com/casey/just) - command runner (optional)\n- [git-cliff](https://github.com/orhun/git-cliff) - changelog generator (optional)\n\nInstall tools:\n\n```bash\njust install-tools\n```\n\n### Common Tasks\n\n```bash\n# Run example\njust run\n\n# Run tests\njust test\n\n# Format and lint\njust fmt\njust clippy\n\n# Check all (format, clippy, tests)\njust check-all\n\n# Release check (format, clippy, test, build)\njust release-check\n\n# Generate demo GIF (requires VHS)\njust vhs\n```\n\n### Release Workflow\n\n```bash\n# Release to GitHub only\njust release 0.2.0\n\n# Release to Gitea only (if configured)\njust release-gitea 0.2.0\n\n# Release to both GitHub and Gitea\njust release-all 0.2.0\n```\n\nThe release commands automatically:\n1. Bump version in Cargo.toml\n2. Update Cargo.lock\n3. Generate changelog with git-cliff\n4. Create git commit and tag\n5. Push to the selected remote(s)\n\n### Dual Hosting Commands\n\nIf you have a Gitea instance configured:\n\n```bash\n# Setup Gitea remote\njust setup-gitea git@gitea.yourdomain.com:username/tui-checkbox.git\n\n# Push to both GitHub and Gitea\njust push-all\n\n# Sync Gitea with GitHub\njust sync-gitea\n\n# Show configured remotes\njust remotes\n```\n\nSee all available commands:\n\n```bash\njust --list\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Contributing\n\nContributions are welcome! Please follow these guidelines:\n\n1. **Fork the repository** on GitHub\n2. **Create a feature branch** from `main`\n3. **Make your changes** with clear commit messages\n4. **Submit a pull request** to the main repository\n\nAll contributions must be made through GitHub pull requests from your fork. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.\n\n## Acknowledgments\n\nThis widget was created for the [Ratatui](https://github.com/ratatui/ratatui) ecosystem.\n\nSpecial thanks to the Ratatui team for creating such an amazing TUI framework.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorinirimies%2Ftui-checkbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorinirimies%2Ftui-checkbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorinirimies%2Ftui-checkbox/lists"}