Tabs

A set of layered sections of content—known as tab panels—that are displayed one at a time.

  • Name@spark-ui/tabs
    Version2.2.0
    LicenseMIT
    npmgithubReported IssuesReport a bug
  • Tabs#

    Contains all the tabs component parts.

    AttributeTypeDescriptionDefault
    asChildbooleanChange the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.false
    defaultValuestringThe value of the tab to select by default, if uncontrollednull
    dir"ltr" | "rtl"The direction of navigation between toolbar items.null
    valuestringThe value for the selected tab, if controllednull
    onValueChange(value: string) => voidA function called when a new tab is selectednull
    orientation"horizontal" | "vertical"The orientation the tabs are layed out. Mainly so arrow navigation is done accordingly (left & right vs. up & down) @defaultValue horizontalnull
    intent"main" | "support" | "basic"Change the color scheme of the tabsbasic
    size"xs" | "sm" | "md"Change the size of the tabsmd

    Tabs.List#

    Contains the triggers that are aligned along the edge of the active content.

    AttributeTypeDescriptionDefault
    asChildbooleanChange the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.{"value":false}
    loopbooleanWhen true, keyboard navigation will loop from last tab to first, and vice versa.{"value":false}

    Tabs.Trigger#

    The button that activates its associated content.

    AttributeTypeDescriptionDefault
    value*stringA unique value that associates the trigger with a content.null
    asChildbooleanChange the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.{"value":false}
    disabledbooleanWhen true, prevents the user from interacting with the tab.{"value":false}

    Tabs.Content#

    Contains the content associated with each trigger.

    AttributeTypeDescriptionDefault
    value*stringA unique value that associates the content with a trigger.null
    asChildbooleanChange the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.{"value":false}
    forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.null