Add a panel
Add a tab to the session's pane, next to the chat, and draw your plugin's own screen in it.
A panel adds a tab next to the chat, for something your plugin shows all the time: a list, a log, a live run. You write the browser part in Solid, React, Preact or plain DOM. Pick a tab: the site keeps your pick on every page.
In React and Preact the panel lives in your app. Give it to <ConcivWidget> as in
Build your first plugin. The widget's ctx.ui parts,
such as Icon, are Solid components. The other tabs draw plain elements instead.
Copy this prompt into your agent. It builds this in your project from this page.
Build this in my project with conciv. conciv is a dev-only AI agent widget, and it already runs in my app. 1. Read https://conciv.dev/docs/plugins/guides/panel.md and follow it. It is the source of truth for the API. 2. If the project has the conciv-develop skill (conciv init installs it with the @conciv/skills docs pack), load it too. 3. Add a tab to the conciv panel from my plugin. 4. If I did not say what it should do, ask me before you write code. 5. Write the browser part in the UI framework my app uses. For React or Preact, put it in my app with @conciv/react or @conciv/preact and give it to <ConcivWidget>, as the page shows. For anything else, use Solid in the plugin folder and build it as the page shows. 6. Install only the packages the page lists, with the package manager this project uses. 7. Tell me to open the conciv panel and look for the tab. 8. When you are done, tell me what you changed and how to see it.
Add a tab
Add the panel in your plugin's browser part:
import {, Plugin, type PanelTab} from '@conciv/frontend-plugin-api'
export default Plugin.({
() {
const : PanelTab = {
: 'shelf',
: 'Shelf', // <- the tab's name, wherever the widget needs text
: true, // <- always in the strip
: () => (
<>
<.. ="box" ="small" />
Shelf
</>
), // <- what the strip draws; without it, the title
}
.(, {
: 'shelf',
: 'pane', // <- required, and the only region today
: () => [],
: () => <>Plants in {..}</>,
})
},
})import {, type PanelProps, type PanelTab, type Plugin} from '@conciv/frontend-plugin-api'
import {} from '@conciv/react'
const : PanelTab = {
: 'shelf',
: 'Shelf', // <- the tab's name, wherever the widget needs text
: true, // <- always in the strip
}
function (: PanelProps) {
return <>Plants in {..}</>
}
export const : Plugin. = () => {
.(, {
: 'shelf',
: 'pane', // <- required, and the only region today
: () => [],
: (),
})
}import {, type PanelProps, type PanelTab, type Plugin} from '@conciv/frontend-plugin-api'
import {} from '@conciv/preact'
const : PanelTab = {
: 'shelf',
: 'Shelf', // <- the tab's name, wherever the widget needs text
: true, // <- always in the strip
}
function (: PanelProps) {
return <>Plants in {..}</>
}
export const : Plugin. = () => {
.(, {
: 'shelf',
: 'pane', // <- required, and the only region today
: () => [],
: (),
})
}import {, , Plugin, type PanelProps, type PanelTab} from '@conciv/frontend-plugin-api'
const : PanelTab = {
: 'shelf',
: 'Shelf', // <- the tab's name, wherever the widget needs text
: true, // <- always in the strip
}
export default Plugin.({
() {
.(, {
: 'shelf',
: 'pane', // <- required, and the only region today
: () => [],
: <PanelProps>((, ) => {
const = .(.('p'))
const = .(() => {
. = `Plants in ${.()..}` // <- runs now, and on every change
})
return () => {
()
.()
}
}),
})
},
})Your plugin adds a tab
A scripted session in the real panel. It plays in your browser, with no server.
Your plugin adds a tab
You: Where do I find the shelf?
Your plugin added a Shelf tab to the pane. Here it is.
The reader clicks “Shelf”.
A few things to notice:
titleis the tab's name. The strip drawslabelwhen you give one, and the title when you do not.listreturns the tabs to show. It runs again when what it reads changes. Return a pinned tab every time.renderdraws a tab's content once. Your component updates itself from then on.props.sessionis the session on screen. Read it where you use it. It changes without a remount.
Build or wire it as in Build or wire the browser part, then reload.
Show a tab only some of the time
Return the tab from list only when it applies:
import {, Plugin, type PanelTab} from '@conciv/frontend-plugin-api'
export default Plugin.
import
import
import {
A tab that is not pinned shows only while the user has it open. When they close it, it leaves input.open. Build or
wire it as in Build or wire the browser part, then
reload.
Load data into the tab
Read from your engine part inside render. In Solid, use the widget's query hooks from @conciv/client, so the
data shares the widget's cache. The tutorial did not install it. The widget provides it at run time, and the install
gives your editor its types:
npm install -D @conciv/clientpnpm add -D @conciv/clientyarn add --dev @conciv/clientbun add --dev @conciv/clientThose hooks are Solid hooks. The other tabs call the method themselves:
import {
import
import
import {
ctx.client.rpc(Shelf) calls your engine part through its contract. See
Share an RPC method. Build or wire it as in
Build or wire the browser part, then reload.
Next steps
- Add a slot or composer pill: smaller places for your plugin in the widget.
- Share an RPC method: the methods your panel reads.