diff --git a/thaw/src/anchor/anchor_link.rs b/thaw/src/anchor/anchor_link.rs index fa6b50d..7c545f0 100644 --- a/thaw/src/anchor/anchor_link.rs +++ b/thaw/src/anchor/anchor_link.rs @@ -6,7 +6,9 @@ use thaw_utils::{class_list, StoredMaybeSignal}; #[component] pub fn AnchorLink( #[prop(optional, into)] class: MaybeProp, + /// The content of link. #[prop(into)] title: MaybeSignal, + /// The target of link. #[prop(into)] href: String, #[prop(optional)] children: Option, ) -> impl IntoView { diff --git a/thaw/src/anchor/mod.rs b/thaw/src/anchor/mod.rs index b2578dc..80e031c 100644 --- a/thaw/src/anchor/mod.rs +++ b/thaw/src/anchor/mod.rs @@ -10,6 +10,8 @@ use web_sys::{DomRect, Element}; #[component] pub fn Anchor( #[prop(optional, into)] class: MaybeProp, + /// The element or selector used to calc offset of link elements. + /// If you are not scrolling the entire document but only a part of it, you may need to set this. #[prop(into, optional)] offset_target: Option, children: Children, ) -> impl IntoView { diff --git a/thaw/src/back_top/mod.rs b/thaw/src/back_top/mod.rs index 98eefd3..b0ca905 100644 --- a/thaw/src/back_top/mod.rs +++ b/thaw/src/back_top/mod.rs @@ -9,8 +9,11 @@ use thaw_utils::{ #[component] pub fn BackTop( #[prop(optional, into)] class: MaybeProp, + /// The width of BackTop from the right side of the page. #[prop(default=40.into(), into)] right: MaybeSignal, + /// The height of BackTop from the bottom of the page. #[prop(default=40.into(), into)] bottom: MaybeSignal, + /// BackTop's trigger scroll top. #[prop(default=180.into(), into)] visibility_height: MaybeSignal, #[prop(optional)] children: Option, ) -> impl IntoView { diff --git a/thaw/src/breadcrumb/mod.rs b/thaw/src/breadcrumb/mod.rs index af0f87c..4d6bae7 100644 --- a/thaw/src/breadcrumb/mod.rs +++ b/thaw/src/breadcrumb/mod.rs @@ -32,6 +32,7 @@ pub fn BreadcrumbItem( #[component] pub fn BreadcrumbButton( #[prop(optional, into)] class: MaybeProp, + /// Defines current sate of BreadcrumbButton. #[prop(optional, into)] current: MaybeSignal, children: Children, ) -> impl IntoView { diff --git a/thaw/src/button/button_group.rs b/thaw/src/button/button_group.rs index e14b205..4b1db52 100644 --- a/thaw/src/button/button_group.rs +++ b/thaw/src/button/button_group.rs @@ -4,6 +4,7 @@ use thaw_utils::{class_list, mount_style}; #[component] pub fn ButtonGroup( #[prop(optional, into)] class: MaybeProp, + /// Directions of buttons in the group. #[prop(optional)] vertical: bool, children: Children, ) -> impl IntoView { diff --git a/thaw/src/button/mod.rs b/thaw/src/button/mod.rs index 8069415..d378fbf 100644 --- a/thaw/src/button/mod.rs +++ b/thaw/src/button/mod.rs @@ -65,12 +65,18 @@ impl ButtonSize { #[component] pub fn Button( #[prop(optional, into)] class: MaybeProp, + /// A button can have its content and borders styled for greater emphasis or to be subtle. #[prop(optional, into)] appearance: MaybeSignal, + /// A button can be rounded, circular, or square. #[prop(optional, into)] shape: MaybeSignal, + /// A button supports different sizes. #[prop(optional, into)] size: MaybeSignal, + /// Whether the button is displayed as block. #[prop(optional, into)] block: MaybeSignal, #[prop(optional, into)] icon: OptionalMaybeSignal, + /// Whether the button is disabled. #[prop(optional, into)] disabled: MaybeSignal, + /// When set, allows the button to be focusable even when it has been disabled. #[prop(optional, into)] disabled_focusable: MaybeSignal, #[prop(optional, into)] on_click: Option>, #[prop(optional)] children: Option, diff --git a/thaw/src/calendar/mod.rs b/thaw/src/calendar/mod.rs index 5d6c918..fc87045 100644 --- a/thaw/src/calendar/mod.rs +++ b/thaw/src/calendar/mod.rs @@ -7,6 +7,7 @@ use thaw_utils::{class_list, mount_style, OptionModel}; #[component] pub fn Calendar( #[prop(optional, into)] class: MaybeProp, + /// Default selected date. #[prop(optional, into)] value: OptionModel, ) -> impl IntoView { mount_style("calendar", include_str!("./calendar.css")); diff --git a/thaw/src/checkbox/mod.rs b/thaw/src/checkbox/mod.rs index c754342..b5b8771 100644 --- a/thaw/src/checkbox/mod.rs +++ b/thaw/src/checkbox/mod.rs @@ -8,9 +8,12 @@ use thaw_utils::{class_list, mount_style, Model}; #[component] pub fn Checkbox( + /// The controlled value for the checkbox. #[prop(optional, into)] checked: Model, #[prop(optional, into)] class: MaybeProp, + /// The value of the checkbox to be used in a checkbox group. #[prop(optional, into)] value: Option, + /// The Checkbox's label. #[prop(optional, into)] label: MaybeProp, ) -> impl IntoView { mount_style("checkbox", include_str!("./checkbox.css")); diff --git a/thaw/src/combobox/combobox.rs b/thaw/src/combobox/combobox.rs index 5c6be09..6dd9811 100644 --- a/thaw/src/combobox/combobox.rs +++ b/thaw/src/combobox/combobox.rs @@ -10,6 +10,7 @@ pub fn Combobox( #[prop(optional, into)] class: MaybeProp, #[prop(optional, into)] value: Model, #[prop(optional, into)] selected_options: VecModel, + /// If set, the combobox will show an icon to clear the current value. #[prop(optional)] clearable: bool, children: Children, ) -> impl IntoView { diff --git a/thaw/src/combobox/combobox_option.rs b/thaw/src/combobox/combobox_option.rs index a5d2333..923ed04 100644 --- a/thaw/src/combobox/combobox_option.rs +++ b/thaw/src/combobox/combobox_option.rs @@ -7,7 +7,9 @@ use thaw_utils::class_list; #[component] pub fn ComboboxOption( #[prop(optional, into)] class: MaybeProp, + /// Defines a unique identifier for the option. Defaults to `text` if not provided. #[prop(optional, into)] value: Option, + /// An optional override the string value of the Option's display text, defaulting to the Option's child content. #[prop(into)] text: String, #[prop(optional)] children: Option, ) -> impl IntoView { diff --git a/thaw/src/dialog/dialog.rs b/thaw/src/dialog/dialog.rs index 277de5d..5cf01f3 100644 --- a/thaw/src/dialog/dialog.rs +++ b/thaw/src/dialog/dialog.rs @@ -6,6 +6,7 @@ use thaw_utils::{class_list, mount_style, Model}; #[component] pub fn Dialog( #[prop(optional, into)] class: MaybeProp, + /// Controls the open state of the dialog #[prop(into)] open: Model, #[prop(default = true.into(), into)] mask_closeable: MaybeSignal, #[prop(default = true, into)] close_on_esc: bool,