Crates.io | leptos_color |
lib.rs | leptos_color |
version | |
source | src |
created_at | 2024-10-17 14:40:56.675523 |
updated_at | 2024-10-17 14:40:56.675523 |
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 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.
Add the following to your Cargo.toml
:
[dependencies]
leptos_color = "0.6.14"
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.