Skip to content

Tabs components

Simple helpers around dmc Tab component. This is only valid for DMC versions prior to those using TabsTab

Tabs

Helper method to deal with a list of tabs

def tabs(tabs_list: list[dmc.Tab], tabs_id: str, value: str) -> dmc.Tabs:
    """
    Renders a dmc.Tabs components
    """
    return dmc.Tabs(children=[dmc.TabsList(tabs_list)], id=tabs_id, value=value)

Tab

Helper method for creating a tab

def tab(value: str):
    """
    Renders a dmc.Tab component
    """
    return dmc.Tab(' '.join(value.split('_')).capitalize(), value=value)