Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you disable tabs in SemanticUI?

It's possible disable a tab on semantic-ui Tab

like image 750
user2669011 Avatar asked Mar 14 '23 00:03

user2669011


2 Answers

Changing

 <a class="item" data-tab="examples">Examples</a>

to

<span class="item disabled">Examples</span>

appears to do the trick.

like image 155
ceejayoz Avatar answered Mar 24 '23 11:03

ceejayoz


If anyone is trying to disable tab with Semantic UI React using panes, this can be done by wrapping menuItem inside <Menu.Item/>.

const panes = [
  {
    menuItem: "Menu 1", // <-- a string
    render: () => (
      <Tab.Pane attached={false}>
        <Stuff1/>
      </Tab.Pane>
    ),
  },
  {
    menuItem: <Menu.Item disabled>Menu 2</Menu.Item>, // <-- a menu item
    render: () => (
      <Tab.Pane attached={false}>
        <Stuff2/>
      </Tab.Pane>
    ),
  },
];

return (
  <Tab
    fluid
    menu={{ secondary: true, pointing: true, widths: panes.length }}
    panes={panes}
  />
);
like image 28
Aishah Sofea Avatar answered Mar 24 '23 11:03

Aishah Sofea