OctantisWeb.Components.Polaris.Tabs (octantis v0.2.0)
View SourceUse to alternate among related views within the same context.
Examples
<.card padding={[xs: "0"]}>
<.tabs id="customers">
<:tab
content="All"
accessibility_label="All customers"
>
<.box padding={[md: "200"]}>All Customers</.box>
</:tab>
<:tab content="Accepts marketing">
<.box padding={[md: "200"]}>Accepts marketing</.box>
</:tab>
<:tab
content="Repeat customers"
accessibility_label="Repeat customers"
>
<.box padding={[md: "200"]}>Repeat customers</.box>
</:tab>
<:tab content="Prospects">
<.box padding={[md: "200"]}>Prospects</.box>
</:tab>
</.tabs>
</.card>See
Summary
Functions
Attributes
accessibility_label(:string) - Defaults tonil.badge(:any) - Defaults tonil.id(:any) - Defaults tonil.panel_id(:any) - Defaults tonil.content(:string) - Defaults tonil.image_source(:string) - Defaults tonil.disabled(:any) - Defaults tofalse.sibling_tab_has_focus(:boolean) - Defaults tofalse.focused(:any) - Defaults tonil.selected(:boolean) - Defaults tofalse.phx_focus(:any) - onFocus. Defaults tonil.phx_keydown(:any) - onKeyDown. Defaults tonil.phx_click(:any) - onClick. Defaults tonil.phx_target(:any) - Allows setting the target for the button. Defaults tonil.
Use to alternate among related views within the same context.
Functions
Attributes
accessibility_label(:string) - Defaults tonil.badge(:any) - Defaults tonil.id(:any) - Defaults tonil.panel_id(:any) - Defaults tonil.content(:string) - Defaults tonil.image_source(:string) - Defaults tonil.disabled(:any) - Defaults tofalse.sibling_tab_has_focus(:boolean) - Defaults tofalse.focused(:any) - Defaults tonil.selected(:boolean) - Defaults tofalse.phx_focus(:any) - onFocus. Defaults tonil.phx_keydown(:any) - onKeyDown. Defaults tonil.phx_click(:any) - onClick. Defaults tonil.phx_target(:any) - Allows setting the target for the button. Defaults tonil.
Use to alternate among related views within the same context.
Examples
<.card padding={[xs: "0"]}>
<.tabs id="customers">
<:tab
content="All"
accessibility_label="All customers"
>
<.box padding={[md: "200"]}>All Customers</.box>
</:tab>
<:tab content="Accepts marketing">
<.box padding={[md: "200"]}>Accepts marketing</.box>
</:tab>
<:tab
content="Repeat customers"
accessibility_label="Repeat customers"
>
<.box padding={[md: "200"]}>Repeat customers</.box>
</:tab>
<:tab content="Prospects">
<.box padding={[md: "200"]}>Prospects</.box>
</:tab>
</.tabs>
</.card>See
- https://polaris.shopify.com/components/navigation/tabs
- https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/Tabs/Tabs.tsx
Attributes
id(:string) (required)selected(:integer) - The index of the currently selected Tab. Defaults to0.disabled(:boolean) - Whether the Tabs are disabled or not. Defaults tofalse.bottom_tabs(:boolean) - Should the tabs be below the content?. Defaults tofalse.inline_align(:string) - Horizontal alignment of children. Defaults tonil.phx_focus(:any) - onFocus. Defaults tonil.phx_blur(:any) - onBlur. Defaults tonil.phx_keydown(:any) - onKeyDown. Defaults tonil.phx_keyup(:any) - onKeyUp. Defaults tonil.
Slots
tab- Accepts attributes:accessibility_label(:any)id(:any)panel_id(:any)content(:string)disabled(:any)selected(:integer)phx_focus(:any)phx_keydown(:any)phx_click(:any)phx_target(:any)
block_stack