Skip to main content

Scaffolding

Trait Scaffolding 

Source
pub trait Scaffolding: ThemeExt {
    // Provided methods
    fn page_column(&self) -> Div { ... }
    fn page_header(
        &self,
        title: impl Into<SharedString>,
        count: Option<usize>,
    ) -> Div { ... }
    fn page_subtitle(&self, copy: impl Into<SharedString>) -> Div { ... }
    fn field_label(&self, label: impl Into<SharedString>) -> Div { ... }
    fn option_card_row(&self) -> Div { ... }
    fn option_card(
        &self,
        label: impl Into<SharedString>,
        selected: bool,
        preview: AnyElement,
    ) -> Div { ... }
    fn group_box(&self) -> Div { ... }
    fn card_row(&self, first: bool) -> Div { ... }
    fn row_tile(&self, icon_path: &'static str) -> Div { ... }
    fn row_title(&self, title: impl Into<SharedString>) -> Div { ... }
    fn meta_line(&self, fragments: Vec<AnyElement>) -> Div { ... }
}

Provided Methods§

Source

fn page_column(&self) -> Div

Centered page column: mx-auto w-full max-w-3xl px-6 pb-16 pt-8.

Source

fn page_header( &self, title: impl Into<SharedString>, count: Option<usize>, ) -> Div

Page headline row: flex items-baseline gap-2.5text-base font-semibold title + text-[13px] count sharing a baseline (the reference settings.devices.tsx).

Source

fn page_subtitle(&self, copy: impl Into<SharedString>) -> Div

Subtitle under the headline: mt-1 text-[13px] text-muted-foreground.

Source

fn field_label(&self, label: impl Into<SharedString>) -> Div

Small label above a group of controls (text-[13px] font-medium) — the “Theme” caption over a picker, not a page headline.

Source

fn option_card_row(&self) -> Div

A row of equally-sized preview cards for picking one of N visual options.

Deliberately knows nothing about themes: the caller supplies each preview as an arbitrary element and picks however many cards it wants, so the same control works for a density picker, a layout picker or anything else where the choice is easier to show than to describe. Pair with Self::option_card.

Source

fn option_card( &self, label: impl Into<SharedString>, selected: bool, preview: AnyElement, ) -> Div

One card in an Self::option_card_row: a fixed-height preview frame that carries the selection ring, with a caption underneath.

preview fills the frame and must round its own corners to OPTION_CARD_RADIUS if it paints a background — see that constant.

Returns a plain Div like the rest of this module — the caller adds .id(..) and .on_click(..), so selection behaviour stays with the page that owns the state.

Source

fn group_box(&self) -> Div

Section card: mt-6 overflow-hidden rounded-xl border border-border bg-card — the card tone, thinned to a translucent tint over glass so the card reads as frost instead of a solid slab (Theme::card_glass_bg).

Source

fn card_row(&self, first: bool) -> Div

One card row: border-t border-border px-5 py-3.5 first:border-t-0. Hover is caller-owned — gpui panics on a second hover, so the default wash is super::card_row_hover for the caller to chain.

Source

fn row_tile(&self, icon_path: &'static str) -> Div

The identity tile on a row: size-9 rounded-[10px] border bg-white/[0.03] around a 16px icon.

Source

fn row_title(&self, title: impl Into<SharedString>) -> Div

Row title: text-[13.5px] font-medium leading-tight.

Source

fn meta_line(&self, fragments: Vec<AnyElement>) -> Div

The quiet meta line under a row title: text-[11.5px] text-muted-foreground/65 fragments joined by dots.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Scaffolding for Theme

Implementors§