
This change makes the `Cell::symbol` field an `Option<CompactString>`, allowing it to represent an empty cell as `None` instead of an empty string. The rationale for this is to later allow the merge symbol functionality to act differently based on whether a cell has previously held a symbol or not, rather than always merging with an empty string. This will help make it possible to merge borders with titles with spaces and other symbols, without assuming that an empty string is always equivalent to no symbol. - Default is now derived as `Option::None` works correctly. - PartialEq and Eq implementations are updated to treat `None` the same as an empty string. - merge_symbol against an empty cell will now just set the symbol rather than calling MergeStrategy::merge with an empty string. - PartialEq, and Hash are manually implementated instead of being derived, and are updated to treat `None` equal to an empty string.
Ratatui Core
ratatui-core is the core library of the ratatui project, providing the essential building blocks for creating rich terminal user interfaces in Rust.
Why ratatui-core
?
The ratatui-core
crate is split from the main ratatui
crate
to offer better stability for widget library authors. Widget libraries should generally depend
on ratatui-core
, benefiting from a stable API and reducing the need for frequent updates.
Applications, on the other hand, should depend on the main ratatui
crate, which includes
built-in widgets and additional features.
Installation
Add ratatui-core
to your Cargo.toml
:
cargo add ratatui-core
Crate Organization
ratatui-core
is part of the Ratatui workspace that was modularized in version 0.30.0 to
improve compilation times, API stability, and dependency management. This crate provides the
foundational types and traits that other crates in the workspace depend on.
When to use ratatui-core
:
- Building widget libraries that implement
Widget
orStatefulWidget
- Creating lightweight applications that don't need built-in widgets
- You want minimal dependencies and faster compilation times
- You need maximum API stability (core types change less frequently)
When to use the main ratatui
crate:
- Building applications that use built-in widgets
- You want convenience and don't mind slightly longer compilation times
- You need backend implementations and terminal management utilities
For detailed information about the workspace organization, see ARCHITECTURE.md.
Contributing
We welcome contributions from the community! Please see our CONTRIBUTING guide for more details on how to get involved.
License
This project is licensed under the MIT License. See the LICENSE file for details.