2 releases

0.1.4 Oct 10, 2024
0.1.3 Oct 8, 2024
0.1.2 Oct 5, 2024
0.1.1 Oct 5, 2024
0.1.0 Oct 5, 2024

#128 in Configuration

Download history 299/week @ 2024-09-30 303/week @ 2024-10-07 17/week @ 2024-10-14

619 downloads per month

MIT license

37KB
746 lines

Freyr UI Components Library for Dioxus.

Why the name Freyr?

Freyr is the norse god of fertility and prosperity and is known for his beauty. Your Dioxus app should also look good.

cargo add freyr

This crate provides a set of customizable UI components for use in Dioxus projects. It allows developers to easily integrate and style components such as navbars and buttons, with flexible configuration options for color schemes, layouts, and responsiveness.

Warning:

This component is in the early stage of development. Right now there are only four components available: two navbar components, a dropdown and the buttons.

Components

  • BasicButton: A customizable button with color options, hover effects, and more.
  • Navbar: A fully customizable navigation bar, custom colors, and responsive layouts.
  • NavbarWithLogo: A fully customizable navigation bar, custom colors, and responsive layouts with an image logo.
  • Dropdown: A dropdown menu with customizable background colors and labels colors.

Key Features

  • Full customization of colors, sizes, and layouts using configuration structs and enums.
  • Responsive designs that adapt seamlessly to mobile and desktop layouts.
  • Easy integration into Dioxus projects, with CSS styles scoped to each component.

Example Usage

#![allow(non_snake_case)]
use freyr::prelude::*;
use dioxus::prelude::*;

#[component]
fn HomePage() -> Element {
    let navbar_config = NavbarConfig {
        background_color: ColorScheme::Freyr, 
        nav_header: "Freyr".to_string(),
        nav_items: vec!["Home".to_string(), "About".to_string(), "Contact".to_string()],
        nav_links: vec!["/".to_string(), "/about".to_string(), "/contact".to_string()],
        nav_item_color: NavItemsColor::Custom("#990000"),
        icon_color: IconColor::Custom("#99cc00"),
    };

    rsx! {
        Navbar { navbar_config }

        div {
            style: "margin-top: 5em;",
            BasicButton { color: ButtonColor::Success, label: "Success" }
        }
    }
}

Contribution

Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub.

Dependencies

~19–32MB
~505K SLoC