MYDS Logo

    MYDS

    Beta

    Tabs

    Allows users to navigate between different views or content sections within the same context by clicking on tab.

    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.

    Usage

    import {
      Tabs,
      TabsContent,
      TabsCounter,
    } from "@/components/myds";
    export default () => (
      <Tabs>
        <TabsList>
          <TabsTrigger />
        </TabsList>
        <TabsContent />
      </Tabs>
    );

    Examples

    Variant

    Use the variant prop to change the tabs style. Currently, there are 3 designs for the tabs which are outlined below:

    1. Pill: Features a pill-shaped design where the active tab is highlighted.
    2. Enclosed: Encases the entire tab group in a container, with the active tab highlighted using a different pill style.
    3. Line: Uses a line beneath the active tab, typically in a brand color, to indicate the selected tab within the group.
    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.
    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.
    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.

    Size

    Use the size prop to change the size of the tabs. Examples of use cases for both types are outlined below:

    1. Small: Typically used for small components or on smaller devices like mobile phones.
    2. Medium: Commonly applied to medium or large-sized components or devices such as tablets and desktops.

    Line variant

    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.
    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.

    Pill variant

    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.
    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.

    Enclosed variant

    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.
    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.

    Leading Icons

    Leading icons serve as visual indicators placed at the start of tab items, enhancing usability by providing instant recognition of the tab's purpose. TabsIcon subcomponent can be used for that purpose. Furthermore, the TabsIcon can be placed to the left or right to the description of TagsTrigger.

    Novel merupakan karya fiksyen panjang yang memaparkan kisah yang lengkap dengan watak, plot dan latar. Ia biasanya mengandungi pelbagai tema seperti cinta, keluarga, perjuangan hidup dan cabaran masyarakat.

    Counter

    Counters appear as numerical indicators after tab labels, providing at-a-glance information about the quantity of items in each tab category. They help users quickly understand the distribution of items across different tab sections without needing to switch between them.

    A novel is a long work of fiction that presents a complete story with characters, plot, and setting. It typically encompasses various themes such as love, family, life struggles, and societal challenges. Novels allow readers to immerse themselves in new worlds through the author's imagination.

    Props

    Tabs

    The primary container that composes all tab components together, managing state and interactions between triggers and their content panels. It is being built on top of TabsPrimitive.Root.

    PropTypeDefault
    variant
    enum
    line
    size
    enum
    small

    TabsList

    A container that houses and aligns all tab triggers, providing a consistent layout for navigation elements. It is being built on top of TabsPrimitive.List.

    PropTypeDefault
    width
    enum
    fit

    TabsTrigger

    Interactive element that toggles visibility of its corresponding tab panel when selected. It is being built on top of TabsPrimitive.Trigger.

    TabsContent

    The panel that displays content when its corresponding trigger is selected, hiding when another tab is activated. It is being built on top of TabsPrimitive.Content.

    TabsIcon

    The TabsIcon is a wrapper component that applies consistent styling and sizing to icons within TabsTrigger, using context-based size variants (small or medium).

    TabsCounter

    The TabsCounter is a component that displays numerical indicators or badges within TabTrigger, adjusting its text size based on the parent tabs' context (small or medium).

    For more in-depth customization, you can refer to API references in this documentation

    On this page