| Crates.io | leptos_color |
| lib.rs | leptos_color |
| version | 0.8.1 |
| created_at | 2024-10-17 14:40:56.675523+00 |
| updated_at | 2025-12-22 20:42:31.202423+00 |
| description | Leptos Color is a simple Crate that gives access to a color picker for leptos |
| homepage | |
| repository | https://github.com/TimTom2016/leptos_color |
| max_upload_size | |
| id | 1413319 |
| size | 125,749 |
Leptos Color is a simple crate that provides a color picker component for Leptos, a Rust web framework. It allows easy integration of color selection functionality in Leptos applications.
Heavily inspired by React Pick Color
Add the following to your Cargo.toml:
[dependencies]
leptos_color = "0.8.0"
use leptos::*;
use leptos_color::{components::color_picker::ColorPicker, Color};
#[component]
fn App() -> impl IntoView {
let (color, set_color) = create_signal(Color::new(1.0, 1.0, 1.0, 1.0));
view! {
<ColorPicker
color=color
on_change=move |new_color| set_color.set(new_color)
/>
}
}
use leptos::*;
use leptos_color::{components::color_input::ColorInput, Color};
#[component]
fn App() -> impl IntoView {
let color = create_rw_signal(Color::new(1.0, 1.0, 1.0, 1.0));
view! {
<ColorInput
color=color
on_change=move |new_color| color.set(new_color)
/>
}
}
theme: Customize the appearance of the color picker.hide_alpha: Hide the alpha (opacity) input.hide_hex: Hide the hexadecimal color input.hide_rgb: Hide the RGB color inputs.Check the examples/basic-ssr directory for a complete example of how to use Leptos Color in a server-side rendered application.
default: Includes the color_input feature.csr: Client-side rendering support.ssr: Server-side rendering support.hydrate: Hydration support.color_input: Enables the ColorInput component.For more detailed information, check out the API documentation.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.