Using Stand-Alone
Use @deck.gl-community/panels directly when you want panel-based UI without
creating a Deck instance.
The standalone path has three pieces:
- panel composition through panels and panel containers
- mounting through
PanelManagerand standalone panel containers - host theming through exported panel theme variables
When to use this
Use the standalone path when:
- the app does not use deck.gl at all
- the UI should render next to a custom canvas or DOM scene
- you want panel composition without adopting a framework-specific wrapper
Core pieces
MarkdownPanel,CustomPanel,StatsPanel,SettingsPanel, and similar classes define contentColumnPanel,TabbedPanel, andAccordeonPanelcompose multiple panelsPanelBox,PanelModal,PanelSidebar, andPanelFullScreenmount panel content into concrete standalone containersPanelManagermounts panel-managed UI into an HTML elementapplyPanelThemeapplies light or dark panel theme variables to a host elementtoastManagermanages toast state independently of any particular renderer
Example
import {
PANEL_THEME_DARK,
MarkdownPanel,
PanelBox,
PanelManager,
applyPanelTheme,
toastManager
} from '@deck.gl-community/panels';
const hostElement = document.getElementById('panel-root') as HTMLElement;
const panelManager = new PanelManager({parentElement: hostElement});
applyPanelTheme(hostElement, PANEL_THEME_DARK);
const overviewPanel = new MarkdownPanel({
id: 'intro',
title: 'Overview',
markdown: 'Rendered without deck.gl.'
});
panelManager.setProps({
components: [
new PanelBox({
id: 'summary-box',
title: 'Summary',
panel: overviewPanel
})
]
});
toastManager.toast({
type: 'info',
message: 'Rendered without deck.gl.'
});