TabView

TabView[{lbl1expr1, lbl2expr2, }]

represents an object in which clicking the tab with label lbli displays expri.

TabView[{lbl1expr1,lbl2expr2,},i]

makes the i^(th) tab be the one currently selected.

TabView[{{v1,lbl1expr1},{v2,lbl2expr2},},v]

associates values vi with successive tabs, and makes the tab with value v be the one currently selected.

TabView[{expr1,expr2,}]

takes the tab labels to be successive integers.

Details and Options

  • TabView[list,Dynamic[s]] takes the selected tab to be specified by the dynamically updated current value of s, with the value of s being reset if a different tab is selected.
  • The following options can be given:
  • Alignment{Automatic,Automatic}how to align objects in the display area
    AppearanceAutomaticthe overall appearance of the TabView
    BaselinePositionAutomatichow to align with a surrounding text baseline
    BaseStyle{}base style specifications for the TabView
    ContentPaddingTruewhether to shrink the margins tightly around the contents
    ControlPlacement{Automatic,Automatic}where to place the tabs
    EnabledAutomaticwhether the tabs are enabled or grayed out
    FrameMarginsAutomaticmargins inside the overall frame
    ImageMargins0margins around the display area
    ImageSizeAllthe overall image size for the display area
    LabelStyle{}style specifications for the tab area
  • With the default option setting ImageSize->All, TabView always leaves space for the largest of the expri to be displayed, so that its overall size does not change. »
  • With ImageSize->Automatic, TabView leaves space only for the expri currently being displayed.
  • If any of the lbli are Null, the corresponding tabs are left blank. »
  • Appearance->"Limited" specifies that only a limited number of tabs should be displayed at a time, with controls to navigate through different "pages" of tabs.
  • Appearance->{"Limited",n} specifies that only up to n tabs should be displayed at a time.
  • TabView by default displays the lbli in "TabViewLabel" style, which typically uses the system button font.
  • The settings for BaseStyle and LabelStyle are appended to the default styles typically given by the "TabView" and "TabViewLabel" styles in the current stylesheet.

Examples

open allclose all

Basic Examples  (2)

Use default labels for tabs:

Insert labels for each element:

Scope  (11)

TabView Content  (7)

Use graphics as content in TabView:

TabView can contain any expression, including Manipulate:

TabView can be nested:

Use any expression as a label:

Use strings as labels:

Put the labels into text style:

Use Null to indicate a blank tab label:

By default, a TabView leaves enough space to display without ever resizing:

With ImageSize->Automatic, TabView resizes for each pane:

TabView Control  (4)

Start with tab 2 selected:

Select the tab with value v:

By default, the setting is based on position:

Use the {u,lbl->expr} to have u be the setting:

Connect a TabView to a slider:

Use With to replace dynamically scoped variables:

Options  (10)

Alignment  (1)

A list of objects:

Default alignments:

Control horizontal alignment only:

Control horizontal and vertical alignments:

AutoAction  (1)

By default, tabs must be clicked to change the view:

By setting AutoAction->True, moving the mouse over tabs changes the view:

BaselinePosition  (1)

Align with text:

ControlPlacement  (1)

Position the controls:

Enabled  (2)

By default, TabView is enabled:

By setting Enabled->False, TabView is disabled, but visible in its current state:

FrameMargins  (1)

Add margins within the view:

ImageMargins  (1)

Add margins outside the view:

ImageSize  (1)

Control the overall size of TabView:

LabelStyle  (1)

Change the style of the labels:

Applications  (4)

Make a TabView with pictures of Bessel functions:

Show some famous cellular automata in a TabView:

Tab through a list of formulas:

Show the GDP of several countries between 1970-2005:

Properties & Relations  (2)

Use Pane to force linebreaking in the content of TabView:

Dynamic variables will only start updating when displayed:

Possible Issues  (2)

Rules are used to specify labels for tabs:

Give labels explicitly to display rules in the content area:

By default, the entire contents are generated before displaying the output:

Use Dynamic and ImageSize->Automatic to generate the contents only when displayed:

Neat Examples  (2)

Successively nest TabView objects:

View images of knots retrieved from KnotData:

Introduced in 2007
 (6.0)
 |
Updated in 2008
 (7.0)