mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 10:42:08 +00:00
Start on ui root doc
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
parent
edacffab58
commit
740e2cc5bf
1 changed files with 31 additions and 0 deletions
|
@ -9,6 +9,37 @@
|
||||||
//!
|
//!
|
||||||
//! Expect some inconsistencies from component to component as we work out the best way to build these components.
|
//! 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
|
//! ## Design Philosophy
|
||||||
//!
|
//!
|
||||||
//! Work in Progress!
|
//! Work in Progress!
|
||||||
|
|
Loading…
Reference in a new issue