{"id":15858260,"url":"https://github.com/ccbrown/iocraft","last_synced_at":"2026-03-07T10:32:03.461Z","repository":{"id":257526601,"uuid":"850900124","full_name":"ccbrown/iocraft","owner":"ccbrown","description":"A Rust crate for beautiful, artisanally crafted CLIs, TUIs, and text-based IO.","archived":false,"fork":false,"pushed_at":"2025-01-20T23:23:45.000Z","size":4828,"stargazers_count":418,"open_issues_count":5,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-30T07:07:17.951Z","etag":null,"topics":["cli","iocraft","logs","rust","terminal","tui"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/iocraft","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccbrown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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},"funding":{"github":["ccbrown"]}},"created_at":"2024-09-02T03:39:17.000Z","updated_at":"2025-01-29T20:10:08.000Z","dependencies_parsed_at":"2024-09-17T07:46:56.087Z","dependency_job_id":"f22b8fa8-5ac1-4691-8bb5-7069bc1bf856","html_url":"https://github.com/ccbrown/iocraft","commit_stats":null,"previous_names":["ccbrown/iocraft"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbrown%2Fiocraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbrown%2Fiocraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbrown%2Fiocraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbrown%2Fiocraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccbrown","download_url":"https://codeload.github.com/ccbrown/iocraft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236812625,"owners_count":19208890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","iocraft","logs","rust","terminal","tui"],"created_at":"2024-10-05T21:00:32.436Z","updated_at":"2025-10-17T11:31:12.690Z","avatar_url":"https://github.com/ccbrown.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ccode\u003eiocraft\u003c/code\u003e\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003e✨ A Rust crate for beautiful, artisanally crafted CLIs, TUIs, and text-based IO. ✨\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/ccbrown/iocraft/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/ccbrown/iocraft/commit.yaml\" alt=\"GitHub Actions Workflow Status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/iocraft/\"\u003e\u003cimg src=\"https://img.shields.io/docsrs/iocraft\" alt=\"docs.rs\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/iocraft\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/iocraft\" alt=\"crates.io\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://app.codecov.io/github/ccbrown/iocraft\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/ccbrown/iocraft\" alt=\"Codecov\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n`iocraft` is a library for crafting beautiful text output and interfaces for the terminal or\nlogs. It allows you to easily build complex layouts and interactive elements using a\ndeclarative API.\n\n## Features\n\n- Define your UI using a clean, highly readable syntax.\n- Organize your UI using flexbox layouts powered by [`taffy`](https://docs.rs/taffy/).\n- Output colored and styled UIs to the terminal or ASCII output anywhere else.\n- Create animated or interactive elements with event handling and hooks.\n- Build fullscreen terminal applications with ease.\n- Pass props and context by reference to avoid unnecessary cloning.\n- Broad support for both Unix and Windows terminals so your UIs look great everywhere.\n\n## Getting Started\n\nIf you're familiar with React, you'll feel right at home with `iocraft`. It uses all the same\nconcepts, but is text-focused and made for Rust.\n\nHere's your first `iocraft` program:\n\n```rust\nuse iocraft::prelude::*;\n\nfn main() {\n    element! {\n        View(\n            border_style: BorderStyle::Round,\n            border_color: Color::Blue,\n        ) {\n            Text(content: \"Hello, world!\")\n        }\n    }\n    .print();\n}\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/ccbrown/iocraft/refs/heads/main/examples/images/hello-world.png\" height=237 /\u003e\n\nYour UI is composed primarily via the `element!` macro, which allows you to\ndeclare your UI elements in a React/SwiftUI-like syntax.\n\n`iocraft` provides a few built-in components, such as `View`, `Text`, and\n`TextInput`, but you can also create your own using the `#[component]` macro.\n\nFor example, here's a custom component that uses a hook to display a counter\nwhich increments every 100ms:\n\n```rust\nuse iocraft::prelude::*;\nuse std::time::Duration;\n\n#[component]\nfn Counter(mut hooks: Hooks) -\u003e impl Into\u003cAnyElement\u003c'static\u003e\u003e {\n    let mut count = hooks.use_state(|| 0);\n\n    hooks.use_future(async move {\n        loop {\n            smol::Timer::after(Duration::from_millis(100)).await;\n            count += 1;\n        }\n    });\n\n    element! {\n        Text(color: Color::Blue, content: format!(\"counter: {}\", count))\n    }\n}\n\nfn main() {\n    smol::block_on(element!(Counter).render_loop()).unwrap();\n}\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/ccbrown/iocraft/refs/heads/main/examples/images/counter.svg\" /\u003e\n\n## More Examples\n\nThere are many [examples on GitHub](https://github.com/ccbrown/iocraft/tree/main/examples) which\ndemonstrate various concepts such as tables, progress bars, fullscreen apps,\nforms, and more!\n\n\u003cimg src=\"https://raw.githubusercontent.com/ccbrown/iocraft/refs/heads/main/examples/images/table.png\" height=402 /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ccbrown/iocraft/refs/heads/main/examples/images/form.png\" height=387 /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ccbrown/iocraft/refs/heads/main/examples/images/overlap.png\" height=450 /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ccbrown/iocraft/refs/heads/main/examples/images/calculator.png\" height=450 /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ccbrown/iocraft/refs/heads/main/examples/images/weather-powershell.png\" height=350 /\u003e\n\n## Shoutouts\n\n`iocraft` was inspired by [Dioxus](https://github.com/DioxusLabs/dioxus) and\n[Ink](https://github.com/vadimdemedes/ink), which you should also check out,\nespecially if you're building graphical interfaces or interested in using\nJavaScript/TypeScript.\n\nYou may also want to check out [Ratatui](https://github.com/ratatui/ratatui),\nwhich serves a similar purpose with a less declarative API.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","funding_links":["https://github.com/sponsors/ccbrown"],"categories":["Rust","Libraries","Table of Contents"],"sub_categories":["Command-line"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccbrown%2Fiocraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccbrown%2Fiocraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccbrown%2Fiocraft/lists"}