next_rs/
lib.rs

1#![doc(
2    html_logo_url = "https://github.com/next-rs/next-rs/assets/62179149/60e6d58f-6749-4308-86f0-fc0ff28c95f6",
3    html_favicon_url = "https://github.com/next-rs/next-rs/assets/62179149/8ac122c9-e55c-4204-9b53-6981f17cefcc"
4)]
5
6//! # Next RS - Documentation
7//!
8//! Welcome to the official documentation for Next RS, a framework written in Rust that simplifies the process of building
9//! user interfaces. This framework provides a collection of features, each designed to enhance different aspects
10//! of UI development. Below are the features included in the Next RS ecosystem:
11//!
12//! ## Features
13//!
14//! | Feature        | Crate Dependency         | GitHub Repository                                         | Description                                                |
15//! |----------------|--------------------------|------------------------------------------------------------|------------------------------------------------------------|
16//! | `navbar`       |   `yew-navbar`           | [![GitHub](https://img.shields.io/github/stars/next-rs/yew-navbar)](https://github.com/next-rs/yew-navbar)           | Create a responsive top-level navigation bar.             |
17//! | `sidebar`      |   `yew-sidebar`          | [![GitHub](https://img.shields.io/github/stars/next-rs/yew-sidebar)](https://github.com/next-rs/yew-sidebar)        | Build a customizable sidebar navigation component.     |
18//! | `accordion`    | `yew-accordion`          | [![GitHub](https://img.shields.io/github/stars/next-rs/yew-accordion)](https://github.com/next-rs/yew-accordion)     | Build interactive accordion-style components.              |
19//! | `alert`        | `yew-alert`              | [![GitHub](https://img.shields.io/github/stars/next-rs/yew-alert)](https://github.com/next-rs/yew-alert)           | Display alerts with customizable styling and properties.   |
20//! | `i18n`         | `yew-i18n`               | [![GitHub](https://img.shields.io/github/stars/next-rs/yew-i18n)](https://github.com/next-rs/yew-i18n)             | Implement internationalization for multi-language support.  |
21//! | `input`        | `input_yew`              | [![GitHub](https://img.shields.io/github/stars/next-rs/input-yew)](https://github.com/next-rs/input-yew)        | Utilize custom input components for enhanced form handling. |
22//! | `css`          | `stylist`                | [![GitHub](https://img.shields.io/github/stars/futursolo/stylist-rs)](https://github.com/futursolo/stylist-rs)           | Apply styling to your components using the Stylist crate integration.|
23//!
24//! To use a specific feature, enable it using the `features` configuration in your `Cargo.toml` file:
25//!
26//! ```toml
27//! [dependencies]
28//! next-rs = { version = "0.0.13", features = ["navbar", "sidebar", "css"] }
29//! ```
30//!
31//! ## Usage
32//!
33//! To integrate Next RS into your application, follow these steps:
34//!
35//! 1. Add Next RS and the desired feature crates to your `Cargo.toml`.
36//! 2. Import the necessary components from the Next RS crate into your Rust code.
37//! 3. Use the imported components within your Next RS components.
38//!
39//! For example, to use the `Navbar` component, add the following dependency:
40//!
41//! ```toml
42//! [dependencies]
43//! next-rs = { version = "0.0.13", features = ["navbar"] }
44//! ```
45//!
46//! Then, in your Rust code:
47//!
48//! ```rust,no_run
49//! use next_rs::prelude::*;
50//! use next_rs::Navbar;
51//!
52//! #[func]
53//! pub fn MyNavbar() -> Html {
54//!     let menus = vec![/* define your menu items here */];
55//!
56//!     rsx! {
57//!         <Navbar menus={menus} />
58//!         // Your component logic here...
59//!     }
60//! }
61//! ```
62//!
63//! For more detailed information and examples, check the [examples] provided in the library.
64//!
65//! [examples]: https://github.com/next-rs/next-rs/tree/main/examples
66//!
67//! ## Contribution
68//!
69//! If you encounter any issues or have suggestions for improvements, feel free to contribute to the
70//! [GitHub repository](https://github.com/next-rs/next-rs). We appreciate your feedback and involvement
71//! in making Next RS better!
72//!
73//! ## Acknowledgments
74//!
75//! Special thanks to the Yew community and contributors for such an amazing framework.
76//!
77
78pub mod head;
79pub mod image;
80pub mod link;
81pub mod router;
82
83pub use head::Head;
84pub use image::{Image, ImageProps};
85#[cfg(feature = "input")]
86pub use input_yew::CustomInput as Input;
87pub use link::{Link, LinkProps};
88pub use router::*;
89#[cfg(feature = "css")]
90pub use stylist::yew::styled_component;
91pub use web_sys::console::log_1 as log;
92pub use yew::Renderer;
93#[cfg(feature = "accordion")]
94pub use yew_accordion::{Accordion, AccordionButton, AccordionItem};
95#[cfg(feature = "alert")]
96pub use yew_alert::{Alert, AlertProps};
97#[cfg(feature = "i18n")]
98pub use yew_i18n::{use_translation, I18nProvider, YewI18n};
99#[cfg(feature = "navbar")]
100pub use yew_navbar::{Menu, Navbar, NavbarProps};
101pub use yew_router::history;
102#[cfg(feature = "sidebar")]
103pub use yew_sidebar::{MenuItem, Sidebar, SidebarProps};
104
105pub mod prelude {
106    //! The Next RS Prelude
107
108    #[cfg(feature = "csr")]
109    pub use yew::app_handle::AppHandle;
110    pub use yew::callback::Callback;
111    pub use yew::context::{ContextHandle, ContextProvider};
112    pub use yew::events::*;
113    pub use yew::functional::function_component as func;
114    pub use yew::functional::*;
115    pub use yew::html::{
116        create_portal, BaseComponent, Children, ChildrenWithProps, Classes, Component, Context,
117        Html, HtmlResult, NodeRef, Properties, ToHtml,
118    };
119    pub use yew::macros::{classes, html as rsx, html_nested};
120    #[cfg(feature = "csr")]
121    pub use yew::renderer::{set_custom_panic_hook, Renderer};
122    pub use yew::suspense::Suspense;
123    pub use yew::virtual_dom::AttrValue;
124}
125
126pub use self::prelude::*;