Skip to main content

Tabs

Struct Tabs 

Source
pub struct Tabs { /* private fields */ }
Expand description

Tabs, as Filament’s Tabs schema component: one card whose tab list shows one Tab of fields at a time. The first tab is open when the form shows, as in Filament, unless active_tab names another. Every tab’s fields are in the form, so a save sends them all, whichever tab is open.

use ignite_core::layout::{Tab, Tabs};
use ignite_core::{FormLayout, Section};

let layout = FormLayout::new().schema([Tabs::make("Settings").tabs([
    Tab::make("General").schema(["description", "active"]),
    Tab::make("Labels").schema([Section::make("Menu").schema(["menu_name"])]),
])]);

Implementations§

Source§

impl Tabs

Source

pub fn make(label: impl Into<String>) -> Self

Tabs with the label label, which names the tab list for a screen reader, as Tabs::make('Settings'). They have no tabs until tabs.

Source

pub fn tabs(self, tabs: impl IntoIterator<Item = Tab>) -> Self

The tabs, in display order, as ->tabs([...]). Each call adds after the tabs given.

Source

pub fn active_tab(self, tab: usize) -> Self

The tab open when the form shows, counted from 1, as Filament’s ->activeTab(2). A number past the last tab opens the first.

Source

pub fn column_span(self, columns: u8) -> Self

The columns the tabs take in the form’s grid, as ->columnSpan(2).

Source

pub fn column_span_full(self) -> Self

Takes every column, as ->columnSpanFull().

Source

pub fn label(&self) -> &str

The label of the tab list.

Source

pub fn get_tabs(&self) -> &[Tab]

The tabs, in display order.

Source

pub fn active_index(&self) -> usize

The index (from 0) of the tab open when the form shows.

Source

pub fn get_column_span(&self) -> ColumnSpan

The columns the tabs take.

Trait Implementations§

Source§

impl Clone for Tabs

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tabs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Tabs

Source§

impl From<Tabs> for Component

Source§

fn from(tabs: Tabs) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Tabs

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Tabs

Auto Trait Implementations§

§

impl Forget for Tabs

§

impl Freeze for Tabs

§

impl Move for Tabs

§

impl RefUnwindSafe for Tabs

§

impl Send for Tabs

§

impl Sync for Tabs

§

impl Unpin for Tabs

§

impl UnsafeUnpin for Tabs

§

impl UnwindSafe for Tabs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more