composable-html
composable-html is a Rust crate that allows you to define and compose HTML elements in a flexible, declarative way. It contains general-purpose HTML elements, which can be enabled using the elements feature flag (which is off by default).
Install
To install the composable-html crate, you can add it as a dependency in your Cargo.toml file.
Manually
Add the following line to your Cargo.toml under [dependencies] (<version> must be replaced with the correct version reference):
[]
= "<version>"
If you want to enable the "elements" feature (to include general-purpose HTML elements), add it like this:
[]
= { = "<version>", = ["elements"] }
Cargo
Alternatively, you can add the crate using the cargo command:
To enable the "elements" feature flag, use:
Usage
To define a new composable element, create a struct that implements the Render trait. You can find examples in the elements module.
Contributing
Contributions are welcome! If you'd like to contribute, feel free to fork the repository and submit a pull request. Please ensure that your code follows the Rust style and includes tests for any new functionality.
For bug reports or feature requests, please open an issue in the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for more details.