# yew-layout [![master docs](https://img.shields.io/badge/docs-master-blue.svg)](https://malrusayni.gitlab.io/yew-layout/yew_layout/) · [![crate info](https://img.shields.io/crates/v/yew-layout.svg)](https://crates.io/crates/yew-layout) · [![pipeline](https://gitlab.com/MAlrusayni/yew-layout/badges/master/pipeline.svg)](https://gitlab.com/MAlrusayni/yew-layout/pipelines) · [![rustc version](https://img.shields.io/badge/rustc-stable-green.svg)](https://crates.io/crates/yew-layout) · [![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) This crate provides you a layouts components based on [**Yew Framwork**](https://crates.io/crates/yew), those components are used to build your view. [See API Docs](https://malrusayni.gitlab.io/yew-layout/yew_layout/) **NOTE:** yew-layout is not (yet) prodction ready but is good for use in side projects and internal tools. # Available Layouts - **Row**: A layout that align it's children horizontally. - **Column**: A layout that align it's children vertically. # Features - **Reasonable Defaults**: All layouts have reasonable default properties values, which work very well with most use cases. - **Rich Properties**: All layouts have rich properties that can be tweaked in many different ways to fit other use cases. - **Consistent Properties**: Layouts almost have the same properties, So if you decide to change from `Row` to `Column` just do it and properties would work the same, their behavior would change to match the currant layout type!. - **Powered By Flexbox**: `Row` and `Column` uses Flexbox behind the scene, there is no black magic fortunately. # Goal The goal for this crate is to provide you a layout types that is used to layout your views, nothing else. # Quick Example ```rust use css_style::{color, unit::px, Background, Border}; use yew::prelude::*; use yew_layout::{ Align, AlignRows, Column, CrossAlign, Gap, Length, Margin, Overflow, Padding, Row, }; #[function_component(App)] pub fn app() -> Html { let border = Border::from(color::named::DARKORCHID).width(px(2)).dashed(); html! { { (0..=11) .into_iter() .map(|i| html!{
}).collect::() }

{ "Sub-column with scroll bar" }

{ "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl." }

} } ``` this would look like: ![example screenshot](https://gitlab.com/MAlrusayni/yew-layout/-/raw/master/screenshots/example%20-%20simple.png)