Skip to main content
Glama
deleonio
by deleonio
create-button.tsx908 B
import { KolTabs } from '@public-ui/react-v19'; import type { FC } from 'react'; import React, { useState } from 'react'; import { SampleDescription } from '../SampleDescription'; export const CreateButton: FC = () => { const [tabs, setTabs] = useState([ { _label: 'First tab', }, { _label: 'Second Tab', }, ]); const addTab = () => { setTabs([ ...tabs, { _label: `Tab #${tabs.length + 1}`, }, ]); }; return ( <> <SampleDescription> <p>This sample shows KolTabs with a &quot;create tab&quot; button.</p> </SampleDescription> <KolTabs _tabs={tabs} className="mt-4" _label="Tabs with create button" _hasCreateButton _on={{ onCreate: addTab }}> {tabs.map((tab, index) => ( <div key={`tab-${index}`} slot={`tab-${index}`}> Contents of {tab._label} </div> ))} <div slot="tab-1">Contents of Tab 2</div> </KolTabs> </> ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server