For AI agents: the complete documentation index is available at https://ooui-react.pages.dev/en/llms.txt, the full documentation bundle is available at https://ooui-react.pages.dev/en/llms-full.txt, and this page is available as Markdown at https://ooui-react.pages.dev/en/components/tab-panel-layout/index.md.
  • English
  • TabPanelLayout

    Source | Original component

    A tab panel: an item of IndexLayout's options array, with role="tabpanel" on the root. You rarely render it directly.

    Standalone use

    active declares the active state (outputs the oo-ui-tabPanelLayout-active class). label / value / disabled are fields carried along with the tab-set object — the component consumes them, so they are never written as DOM attributes. The panel defaults to expanded (fills its parent via absolute positioning), so when placed on its own it needs a positioned, sized parent.

    General settings
    import { IndexLayout } from "ooui-react";
    
    function App() {
      return (
        <div style={{ position: "relative", height: 180 }}>
          <IndexLayout
            defaultValue="general"
            options={[
              { value: "general", label: "General", padded: true, children: "General settings" },
              { value: "advanced", label: "Advanced", padded: true, children: "Advanced settings" },
            ]}
          />
        </div>
      );
    }
    
    export default App;

    Rendered without an IndexLayout, the active state is declared via active (the root emits the oo-ui-tabPanelLayout-active class; panels default to expanded, filling a positioned parent — pass expanded={false} to place them statically):

    General panel: declared with active, the root emits the oo-ui-tabPanelLayout-active class
    import { TabPanelLayout } from "ooui-react";
    
    function App() {
      return (
        <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
          <TabPanelLayout active padded expanded={false}>
            General panel: declared with active, the root emits the oo-ui-tabPanelLayout-active class
          </TabPanelLayout>
          <TabPanelLayout padded expanded={false} hidden>
            Advanced panel: fully hidden while hidden
          </TabPanelLayout>
        </div>
      );
    }
    
    export default App;

    API

    Inherits all PanelLayout props, plus:

    PropDescriptionTypeDefault
    activeWhether this is the active panelbooleanfalse
    scrollableWhether scrollable (panels scroll by default)booleantrue
    label / value / disabledCarried with the tab-set object, consumed by the componentReactNode / string | number / boolean—

    See also

    • The tab container (with the tabpanel association): IndexLayout