Add some initial docs
This commit is contained in:
parent
d500b01aed
commit
9ce7199d2d
5 changed files with 227 additions and 120 deletions
|
@ -1,29 +1,3 @@
|
|||
// TODO:
|
||||
// Document these:
|
||||
// - [ ] - label
|
||||
// - [ ] - button
|
||||
// - [ ] - icon_button
|
||||
// - [ ] - icon
|
||||
// - [ ] - list
|
||||
// - [ ] - avatar
|
||||
// - [ ] - panel
|
||||
// - [ ] - modal
|
||||
// - [ ] - palette
|
||||
// - [ ] - input
|
||||
// - [ ] - facepile
|
||||
// - [ ] - player
|
||||
// - [ ] - stacks
|
||||
// - [ ] - context menu
|
||||
// - [ ] - input
|
||||
// - [ ] - textarea (not built)
|
||||
// - [ ] - indicator
|
||||
// - [ ] - public actor
|
||||
// - [ ] - keybinding
|
||||
// - [ ] - tab
|
||||
// - [ ] - toast
|
||||
// - [ ] - status_toast (maybe not built?)
|
||||
// - [ ] - notification_toast
|
||||
|
||||
//! # UI – Zed UI Primitives & Components
|
||||
//!
|
||||
//! This crate provides a set of UI primitives and components that are used to build all of the elements in Zed's UI.
|
||||
|
@ -33,44 +7,10 @@
|
|||
//! This crate is still a work in progress. The initial primitives and components are built for getting all the UI on the screen,
|
||||
//! much of the state and functionality is mocked or hard codeded, and performance has not been a focus.
|
||||
//!
|
||||
//! 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!
|
||||
//!
|
||||
|
||||
#![doc = include_str!("../docs/hello-world.md")]
|
||||
#![doc = include_str!("../docs/building-ui.md")]
|
||||
#![doc = include_str!("../docs/todo.md")]
|
||||
// TODO: Fix warnings instead of supressing.
|
||||
#![allow(dead_code, unused_variables)]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue