goyda 0.1.3

A Rust UI toolkit that compiles the same app to Windows, Android, and web
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::components::{Color, Component, LayoutDirection};

pub struct Card;

impl Card {
    /// A [`Stack`](crate::components::Stack) pre-styled as an elevated
    /// surface (white background, rounded corners, a soft shadow, and
    /// breathing-room padding) - the common "content grouped in a box"
    /// pattern, still a plain `Component` underneath so every style method
    /// (`.background(...)`, `.rounded(...)`, ...) can override a default.
    pub fn new(children: Vec<Component>) -> Component {
        Component::stack(LayoutDirection::Vertical, 8, children)
            .background(Color::WHITE)
            .rounded(8)
            .shadow(4)
            .padding(16, 16)
    }
}