ratatui_core/
lib.rs

1#![no_std]
2// show the feature flags in the generated documentation
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![doc(
5    html_logo_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/logo.png",
6    html_favicon_url = "https://raw.githubusercontent.com/ratatui/ratatui/main/assets/favicon.ico"
7)]
8//! **ratatui-core** is the core library of the [ratatui] project,
9//! providing the essential building blocks for creating rich terminal user interfaces in Rust.
10//!
11//! [ratatui]: https://github.com/ratatui/ratatui
12//!
13//! ## Why `ratatui-core`?
14//!
15//! The `ratatui-core` crate is split from the main [`ratatui`](https://crates.io/crates/ratatui) crate
16//! to offer better stability for widget library authors. Widget libraries should generally depend
17//! on `ratatui-core`, benefiting from a stable API and reducing the need for frequent updates.
18//!
19//! Applications, on the other hand, should depend on the main `ratatui` crate, which includes
20//! built-in widgets and additional features.
21//!
22//! # Installation
23//!
24//! Add `ratatui-core` to your `Cargo.toml`:
25//!
26//! ```shell
27//! cargo add ratatui-core
28//! ```
29//!
30//! # Crate Organization
31//!
32//! `ratatui-core` is part of the Ratatui workspace that was modularized in version 0.30.0 to
33//! improve compilation times, API stability, and dependency management. This crate provides the
34//! foundational types and traits that other crates in the workspace depend on.
35//!
36//! **When to use `ratatui-core`:**
37//!
38//! - Building widget libraries that implement [`Widget`] or [`StatefulWidget`]
39//! - Creating lightweight applications that don't need built-in widgets
40//! - You want minimal dependencies and faster compilation times
41//! - You need maximum API stability (core types change less frequently)
42//!
43//! **When to use the main [`ratatui`] crate:**
44//!
45//! - Building applications that use built-in widgets
46//! - You want convenience and don't mind slightly longer compilation times
47//! - You need backend implementations and terminal management utilities
48//!
49//! For detailed information about the workspace organization, see [ARCHITECTURE.md].
50//!
51//! [`ratatui`]: https://crates.io/crates/ratatui
52//! [`Widget`]: widgets::Widget
53//! [`StatefulWidget`]: widgets::StatefulWidget
54//! [ARCHITECTURE.md]: https://github.com/ratatui/ratatui/blob/main/ARCHITECTURE.md
55#![cfg_attr(feature = "document-features", doc = "\n## Features")]
56#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
57//!
58//! # Contributing
59//!
60//! We welcome contributions from the community! Please see our [CONTRIBUTING](../CONTRIBUTING.md)
61//! guide for more details on how to get involved.
62//!
63//! ## License
64//!
65//! This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.
66
67#![warn(clippy::std_instead_of_core)]
68#![warn(clippy::std_instead_of_alloc)]
69#![warn(clippy::alloc_instead_of_core)]
70
71extern crate alloc;
72#[cfg(feature = "std")]
73extern crate std;
74
75pub mod backend;
76pub mod buffer;
77pub mod layout;
78pub mod style;
79pub mod symbols;
80pub mod terminal;
81pub mod text;
82pub mod widgets;