pub struct CodeTabsProps {Show 16 fields
pub items: Vec<CodeTabsItem>,
pub initial_value: Option<String>,
pub storage_key: Option<String>,
pub aria_label: String,
pub copy: bool,
pub wrap: bool,
pub theme: CodeTheme,
pub code_label: Option<String>,
pub copy_label: Option<String>,
pub copied_label: Option<String>,
pub error_label: Option<String>,
pub recovery_label: Option<String>,
pub on_value_change: Option<EventHandler<String>>,
pub on_copy: Option<Callback<String, bool>>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for CodeTabs.
Fields§
§items: Vec<CodeTabsItem>The tabs.
initial_value: Option<String>The tab selected first. Defaults to the first item.
storage_key: Option<String>Shares the selection between CodeTabs with the same key, for example a package manager
choice repeated across a page.
aria_label: StringAccessible name of the tab list. Defaults to “Code examples”.
copy: boolAdds a copy button to every panel. On by default.
wrap: boolWraps long lines. On by default.
theme: CodeThemeSyntax color theme.
code_label: Option<String>Accessible name of each scrollable code region.
copy_label: Option<String>Accessible name of the copy buttons.
copied_label: Option<String>Name and announcement after a copy.
error_label: Option<String>Name and announcement after a failed copy.
recovery_label: Option<String>Shows the code in a read-only text area after a failed copy, under this label.
on_value_change: Option<EventHandler<String>>Called with the newly selected tab value.
on_copy: Option<Callback<String, bool>>Copies through the app instead of the browser clipboard.
class: Option<String>Extra classes appended after the Lumen classes.
attributes: Vec<Attribute>Any other <div> or global attribute.
Implementations§
Source§impl CodeTabsProps
impl CodeTabsProps
Sourcepub fn builder() -> CodeTabsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> CodeTabsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building CodeTabsProps.
On the builder, call .items(...)(optional), .initial_value(...)(optional), .storage_key(...)(optional), .aria_label(...)(optional), .copy(...)(optional), .wrap(...)(optional), .theme(...)(optional), .code_label(...)(optional), .copy_label(...)(optional), .copied_label(...)(optional), .error_label(...)(optional), .recovery_label(...)(optional), .on_value_change(...)(optional), .on_copy(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of CodeTabsProps.
Trait Implementations§
Source§impl Clone for CodeTabsProps
impl Clone for CodeTabsProps
Source§impl PartialEq for CodeTabsProps
impl PartialEq for CodeTabsProps
Source§impl Properties for CodeTabsPropswhere
Self: Clone,
impl Properties for CodeTabsPropswhere
Self: Clone,
Source§type Builder = CodeTabsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = CodeTabsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for CodeTabsProps
Auto Trait Implementations§
impl !RefUnwindSafe for CodeTabsProps
impl !Send for CodeTabsProps
impl !Sync for CodeTabsProps
impl !UnwindSafe for CodeTabsProps
impl Forget for CodeTabsProps
impl Freeze for CodeTabsPropswhere
*const u8 is !null: Freeze,
PhantomData<CodeTabsItem>: Freeze,
PhantomData<u8>: Freeze,
&'static UnsyncStorage: Freeze,
NonZero<u64>: Freeze,
&'static Location<'static>: Freeze,
PhantomData<Option<ExternalListenerCallback<String, ()>>>: Freeze,
PhantomData<Option<ExternalListenerCallback<String, bool>>>: Freeze,
PhantomData<Attribute>: Freeze,
impl Move for CodeTabsProps
impl Unpin for CodeTabsPropswhere
*const u8 is !null: Unpin,
&'static UnsyncStorage: Unpin,
NonZero<u64>: Unpin,
&'static Location<'static>: Unpin,
Box<dyn FnMut(String)>: Unpin,
*const RcInner<Runtime> is !null: Unpin,
Box<dyn FnMut(String) -> bool>: Unpin,
&'static str: Unpin,
Rc<RefCell<dyn FnMut(Event<dyn Any>)>>: Unpin,
Rc<dyn AnyValue>: Unpin,
impl UnsafeUnpin for CodeTabsPropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<CodeTabsItem>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<String, ()>>>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<String, bool>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more