Start on ui root doc

Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
Nate Butler 2023-11-03 16:28:54 -04:00
parent edacffab58
commit 740e2cc5bf

View file

@ -9,6 +9,37 @@
//!
//! Expect some inconsistencies from component to component as we work out the best way to build these components.
//!
//! ## Getting Started
//!
//! This is a quick primer to get you started using the UI components.
//!
//! You shouldn't need to construct an element from scratch very often. If you find
//! yourself manually styling things like hover, text colors, etc, you should
//! probably check that there isn't already a base component for whatever you are building.
//!
//! Here is an into to some of the most common elements:
//!
//! ### Text
//!
//! For generic UI text most frequently you will use a [`Label`] component.
//!
//! ```rust
//! use ui2::prelude::*;
//! use ui2::{Label, LabelColor};
//!
//! pub fn render_some_ui_text<V: 'static>() -> impl Component<V> {
//! div().p_2().child(
//! Label::new("Hello World")
//! .color(LabelColor::Muted)
//! )
//! }
//! ```
//!
//! ### Interactive Elements
//!
//! - Icon: To make an icon interactive, use [`IconButton`].
//! - Button: To make a button interactive, use [`Button`].
//!
//! ## Design Philosophy
//!
//! Work in Progress!