thaw/demo/src/pages/alert/mod.rs

72 lines
2.4 KiB
Rust
Raw Normal View History

2023-10-11 23:02:04 +08:00
use crate::components::{Demo, DemoCode};
use leptos::*;
2023-11-05 16:03:58 +08:00
use thaw::*;
2023-10-11 23:02:04 +08:00
use prisms::highlight_str;
#[component]
pub fn AlertPage() -> impl IntoView {
view! {
<div style="width: 896px; margin: 0 auto;">
<h1>"Alert"</h1>
<Demo>
<Space vertical=true>
2023-10-16 21:15:43 +08:00
<Alert variant=AlertVariant::Success title="title">
2023-10-12 23:25:10 +08:00
"success"
</Alert>
2023-10-16 21:15:43 +08:00
<Alert variant=AlertVariant::Warning title="title">
2023-10-12 23:25:10 +08:00
"warning"
</Alert>
2023-10-16 21:15:43 +08:00
<Alert variant=AlertVariant::Error title="title">
2023-10-12 23:25:10 +08:00
"error"
</Alert>
2023-10-11 23:02:04 +08:00
</Space>
<DemoCode
slot
html=highlight_str!(
r#"
2023-10-16 21:15:43 +08:00
<Alert variant=AlertVariant::Success title="title">"success"</Alert>
<Alert variant=AlertVariant::Warning title="title">"warning"</Alert>
<Alert variant=AlertVariant::Error title="title">"error"</Alert>
2023-10-11 23:02:04 +08:00
"#,
"rust"
)
>
""
</DemoCode>
</Demo>
2023-11-13 22:03:44 +08:00
<h3>"Alert 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>"title"</td>
<td>"MaybeSignal<String>"</td>
<td>r#""""#</td>
<td>"Title of the alert."</td>
</tr>
<tr>
<td>"variant"</td>
<td>"AlertVariant"</td>
<td></td>
<td>"Alert variant."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"The content of the alert."</td>
</tr>
</tbody>
</Table>
2023-10-11 23:02:04 +08:00
</div>
}
}