2023-10-03 17:57:37 +08:00
|
|
|
use crate::components::{Demo, DemoCode};
|
|
|
|
use leptos::*;
|
2023-10-04 00:11:38 +08:00
|
|
|
use prisms::highlight_str;
|
2023-11-16 10:26:32 +08:00
|
|
|
use thaw::*;
|
2023-10-03 17:57:37 +08:00
|
|
|
|
|
|
|
#[component]
|
|
|
|
pub fn SpacePage() -> impl IntoView {
|
|
|
|
view! {
|
|
|
|
<div style="width: 896px; margin: 0 auto;">
|
|
|
|
<h1>"Space"</h1>
|
|
|
|
<Demo>
|
|
|
|
<Space>
|
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-08 09:28:13 +08:00
|
|
|
<DemoCode
|
|
|
|
slot
|
|
|
|
html=highlight_str!(
|
|
|
|
r#"
|
2023-10-04 00:11:38 +08:00
|
|
|
<Space>
|
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-08 09:28:13 +08:00
|
|
|
"#,
|
|
|
|
"rust"
|
|
|
|
)
|
|
|
|
>
|
|
|
|
|
2023-10-04 00:11:38 +08:00
|
|
|
""
|
2023-10-03 17:57:37 +08:00
|
|
|
</DemoCode>
|
|
|
|
</Demo>
|
2023-10-04 22:48:08 +08:00
|
|
|
<h3>"vertical"</h3>
|
|
|
|
<Demo>
|
|
|
|
<Space vertical=true>
|
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-08 09:28:13 +08:00
|
|
|
<DemoCode
|
|
|
|
slot
|
|
|
|
html=highlight_str!(
|
|
|
|
r#"
|
2023-10-04 22:48:08 +08:00
|
|
|
<Space vertical=true>
|
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-08 09:28:13 +08:00
|
|
|
"#,
|
|
|
|
"rust"
|
|
|
|
)
|
|
|
|
>
|
|
|
|
|
2023-10-04 22:48:08 +08:00
|
|
|
""
|
|
|
|
</DemoCode>
|
|
|
|
</Demo>
|
2023-10-03 17:57:37 +08:00
|
|
|
<h3>"gap"</h3>
|
|
|
|
<Demo>
|
2023-10-16 21:15:43 +08:00
|
|
|
<Space gap=SpaceGap::Large>
|
2023-10-03 17:57:37 +08:00
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-16 21:15:43 +08:00
|
|
|
<Space gap=SpaceGap::WH(36, 36)>
|
2023-10-03 17:57:37 +08:00
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-08 09:28:13 +08:00
|
|
|
<DemoCode
|
|
|
|
slot
|
|
|
|
html=highlight_str!(
|
|
|
|
r#"
|
2023-10-16 21:15:43 +08:00
|
|
|
<Space gap=SpaceGap::Large>
|
2023-10-04 00:11:38 +08:00
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-16 21:15:43 +08:00
|
|
|
<Space gap=SpaceGap::WH(36, 36)>
|
2023-10-04 00:11:38 +08:00
|
|
|
<Button>"1"</Button>
|
|
|
|
<Button>"2"</Button>
|
|
|
|
<Button>"3"</Button>
|
|
|
|
</Space>
|
2023-10-08 09:28:13 +08:00
|
|
|
"#,
|
|
|
|
"rust"
|
|
|
|
)
|
|
|
|
>
|
|
|
|
|
2023-10-04 00:11:38 +08:00
|
|
|
""
|
2023-10-03 17:57:37 +08:00
|
|
|
</DemoCode>
|
|
|
|
</Demo>
|
2023-11-16 10:26:32 +08:00
|
|
|
<h3>"Space Props"</h3>
|
|
|
|
<Table single_column=true>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>"Name"</th>
|
|
|
|
<th>"Type"</th>
|
|
|
|
<th>"Default"</th>
|
|
|
|
<th>"Description"</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>"gap"</td>
|
|
|
|
<td>"SpaceGap"</td>
|
|
|
|
<td>"SpaceGap::Medium"</td>
|
|
|
|
<td>"Space's gap."</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>"vertical"</td>
|
|
|
|
<td>"MaybeSignal<f64>"</td>
|
|
|
|
<td>"false"</td>
|
|
|
|
<td>"Whether to lay out vertically."</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>"children"</td>
|
|
|
|
<td>"Children"</td>
|
|
|
|
<td></td>
|
|
|
|
<td>"Space's content."</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</Table>
|
2023-10-03 17:57:37 +08:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|