docs: add props

This commit is contained in:
luoxiao 2023-11-16 10:26:32 +08:00
parent d13928e97d
commit abbaebbfe5
14 changed files with 422 additions and 53 deletions

View file

@ -94,43 +94,6 @@ pub fn LayoutPage() -> impl IntoView {
</tr> </tr>
</tbody> </tbody>
</Table> </Table>
<h3>"Layout 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>"style"</td>
<td>"MaybeSignal<String>"</td>
<td>r#""""#</td>
<td>"Layout's style."</td>
</tr>
<tr>
<td>"position"</td>
<td>"LayoutPosition"</td>
<td>"LayoutPosition::Static"</td>
<td>"static position will make it css position set to static. absolute position will make it css position set to absolute and left, right, top, bottom to 0. absolute position is very useful when you want to make content scroll in a fixed container or make the whole page's layout in a fixed position. You may need to change the style of the component to make it display as you expect."</td>
</tr>
<tr>
<td>"has_sider"</td>
<td>"MaybeSignal<bool>"</td>
<td>"false"</td>
<td>"Whether the component has sider inside. If so it must be true."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Layout's content."</td>
</tr>
</tbody>
</Table>
<h3>"LayoutHeader, LayoutSider Props"</h3> <h3>"LayoutHeader, LayoutSider Props"</h3>
<Table single_column=true> <Table single_column=true>
<thead> <thead>

View file

@ -69,17 +69,17 @@ pub fn LoadingBarPage() -> impl IntoView {
<tbody> <tbody>
<tr> <tr>
<td>"start"</td> <td>"start"</td>
<th>"fn(&self)"</th> <td>"fn(&self)"</td>
<td>"Callback function for loading bar to start loading."</td> <td>"Callback function for loading bar to start loading."</td>
</tr> </tr>
<tr> <tr>
<td>"finish"</td> <td>"finish"</td>
<th>"fn(&self)"</th> <td>"fn(&self)"</td>
<td>"The callback function when the loading bar finishes loading."</td> <td>"The callback function when the loading bar finishes loading."</td>
</tr> </tr>
<tr> <tr>
<td>"error"</td> <td>"error"</td>
<th>"fn(&self)"</th> <td>"fn(&self)"</td>
<td>"Callback function for loading bar error."</td> <td>"Callback function for loading bar error."</td>
</tr> </tr>
</tbody> </tbody>

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn RadioPage() -> impl IntoView { pub fn RadioPage() -> impl IntoView {
@ -30,6 +30,31 @@ pub fn RadioPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Radio 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>"value"</td>
<td>"RwSignal<bool>"</td>
<td>"false"</td>
<td>"Checked value."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Radio's content."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn SelectPage() -> impl IntoView { pub fn SelectPage() -> impl IntoView {
@ -35,6 +35,31 @@ pub fn SelectPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Select 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>"value"</td>
<td>"RwSignal<Option<T>>"</td>
<td>"None"</td>
<td>"Checked value."</td>
</tr>
<tr>
<td>"options"</td>
<td>"MaybeSignal<Vec<SelectOption<T>>>"</td>
<td>"vec![]"</td>
<td>"Options that can be selected."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn SkeletonPage() -> impl IntoView { pub fn SkeletonPage() -> impl IntoView {
@ -25,6 +25,43 @@ pub fn SkeletonPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Skeleton 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>"repeat"</td>
<td>"MaybeSignal<u32>"</td>
<td>"1"</td>
<td>"Repeat frequency."</td>
</tr>
<tr>
<td>"text"</td>
<td>"MaybeSignal<bool>"</td>
<td>"false"</td>
<td>"Text skeleton."</td>
</tr>
<tr>
<td>"width"</td>
<td>"Option<MaybeSignal<String>>"</td>
<td>"None"</td>
<td>"Skeleton width."</td>
</tr>
<tr>
<td>"height"</td>
<td>"Option<MaybeSignal<String>>"</td>
<td>"None"</td>
<td>"Text skeleton."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn SliderPage() -> impl IntoView { pub fn SliderPage() -> impl IntoView {
@ -27,6 +27,31 @@ pub fn SliderPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Slider 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>"value"</td>
<td>"RwSignal<f64>"</td>
<td>"0"</td>
<td>"Value of the slider."</td>
</tr>
<tr>
<td>"max"</td>
<td>"MaybeSignal<f64>"</td>
<td>"100"</td>
<td>"Max value of the slider."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn SpacePage() -> impl IntoView { pub fn SpacePage() -> impl IntoView {
@ -89,6 +89,37 @@ pub fn SpacePage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<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>
</div> </div>
} }
} }

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn SwitchPage() -> impl IntoView { pub fn SwitchPage() -> impl IntoView {
@ -27,6 +27,25 @@ pub fn SwitchPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Swith 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>"value"</td>
<td>"RwSignal<bool>"</td>
<td>"false"</td>
<td>"Swith's value."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }

View file

@ -3,8 +3,8 @@ use crate::{
pages::MobilePage, pages::MobilePage,
}; };
use leptos::*; use leptos::*;
use thaw::mobile::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::{mobile::*, Table};
#[component] #[component]
pub fn TabbarPage() -> impl IntoView { pub fn TabbarPage() -> impl IntoView {
@ -39,6 +39,62 @@ pub fn TabbarPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Tabbar 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>"value"</td>
<td>"RwSignal<String>"</td>
<td>r#""""#</td>
<td>"Tabbar's value."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Tabbar's content."</td>
</tr>
</tbody>
</Table>
<h3>"TabbarItem 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>"key"</td>
<td>"MaybeSignal<String>"</td>
<td>r#""""#</td>
<td>"The indentifier of the tabbar item."</td>
</tr>
<tr>
<td>"icon"</td>
<td>"Option<Icon>"</td>
<td>"None"</td>
<td>"TabbarItem's icon."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"TabbarItem's content."</td>
</tr>
</tbody>
</Table>
</div> </div>
<div> <div>
<MobilePage path="/thaw?path=/mobile/tabbar"/> <MobilePage path="/thaw?path=/mobile/tabbar"/>

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn TablePage() -> impl IntoView { pub fn TablePage() -> impl IntoView {
@ -86,6 +86,18 @@ pub fn TablePage() -> impl IntoView {
<td>"false"</td> <td>"false"</td>
<td>""</td> <td>""</td>
</tr> </tr>
<tr>
<td>"style"</td>
<td>"MaybeSignal<String>"</td>
<td>r#""""#</td>
<td>"Table's style."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Table's content."</td>
</tr>
</tbody> </tbody>
</Table> </Table>
</div> </div>

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn TabsPage() -> impl IntoView { pub fn TabsPage() -> impl IntoView {
@ -39,6 +39,62 @@ pub fn TabsPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Tabs 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>"value"</td>
<td>"RwSignal<String>"</td>
<td>r#""""#</td>
<td>"Tabs value."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Tabs content."</td>
</tr>
</tbody>
</Table>
<h3>"Tab 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>"key"</td>
<td>"String"</td>
<td></td>
<td>"The indentifier of the tab."</td>
</tr>
<tr>
<td>"label"</td>
<td>"String"</td>
<td></td>
<td>"The label of the tab."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Tab's content."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn TagPage() -> impl IntoView { pub fn TagPage() -> impl IntoView {
@ -49,6 +49,31 @@ pub fn TagPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Tag 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>"variant"</td>
<td>"MaybeSignal<TagVariant>"</td>
<td>"TagVariant::Default"</td>
<td>"Tag's variant."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Tag's content."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }

View file

@ -3,10 +3,10 @@ use crate::{
pages::MobilePage, pages::MobilePage,
}; };
use leptos::*; use leptos::*;
use thaw::mobile::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use std::time::Duration; use std::time::Duration;
use thaw::mobile::*;
use thaw::*;
#[component] #[component]
pub fn ToastPage() -> impl IntoView { pub fn ToastPage() -> impl IntoView {
@ -36,6 +36,45 @@ pub fn ToastPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Toast Methods"</h3>
<Table single_column=true>
<thead>
<tr>
<th>"Name"</th>
<th>"Type"</th>
<th>"Description"</th>
</tr>
</thead>
<tbody>
<tr>
<td>"show_toast"</td>
<td>"fn(options: ToastOptions))"</td>
<td>"Show toast."</td>
</tr>
</tbody>
</Table>
<h3>"ToastOptions Properties"</h3>
<Table single_column=true>
<thead>
<tr>
<th>"Name"</th>
<th>"Type"</th>
<th>"Description"</th>
</tr>
</thead>
<tbody>
<tr>
<td>"message"</td>
<td>"String"</td>
<td>"message."</td>
</tr>
<tr>
<td>"duration"</td>
<td>"std::time::Duration"</td>
<td>"show duration."</td>
</tr>
</tbody>
</Table>
</div> </div>
<div> <div>
<MobilePage path="/thaw?path=/mobile/toast"/> <MobilePage path="/thaw?path=/mobile/toast"/>

View file

@ -1,7 +1,7 @@
use crate::components::{Demo, DemoCode}; use crate::components::{Demo, DemoCode};
use leptos::*; use leptos::*;
use thaw::*;
use prisms::highlight_str; use prisms::highlight_str;
use thaw::*;
#[component] #[component]
pub fn UploadPage() -> impl IntoView { pub fn UploadPage() -> impl IntoView {
@ -83,6 +83,62 @@ pub fn UploadPage() -> impl IntoView {
"" ""
</DemoCode> </DemoCode>
</Demo> </Demo>
<h3>"Upload 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>"accept"</td>
<td>"MaybeSignal<String>"</td>
<td>r#""""#</td>
<td>"The accept type of upload."</td>
</tr>
<tr>
<td>"multiple"</td>
<td>"MaybeSignal<bool>"</td>
<td>"false"</td>
<td>"Allow multiple files to be selected."</td>
</tr>
<tr>
<td>"custom_request"</td>
<td>"Option<Callback<FileList, ()>>"</td>
<td>r#""""#</td>
<td>"Customize upload request."</td>
</tr>
<tr>
<td>"children"</td>
<td>"Children"</td>
<td></td>
<td>"Upload's content."</td>
</tr>
</tbody>
</Table>
<h3>"UploadDragger 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>"children"</td>
<td>"Children"</td>
<td></td>
<td>"UploadDragger's content."</td>
</tr>
</tbody>
</Table>
</div> </div>
} }
} }