Examples
Right dock
import { useState } from 'react'
import { DockArea } from '@kition/tessera-ui'
export default function Demo() {
const [shown, setShown] = useState<ReadonlySet<string>>(new Set(['color', 'layers']))
return (
<div style={{ height: 320, display: 'flex', justifyContent: 'flex-end' }}>
<DockArea
kit="tessera-docs"
width={260}
shown={shown}
onShownChange={setShown}
groups={[
{ id: 'color', defaultHeight: 140, tabs: [{ id: 'color', label: 'Color', render: () => <div className="demo-pane">Color</div> }, { id: 'swatches', label: 'Swatches', render: () => <div className="demo-pane">Swatches</div> }] },
{ id: 'layers', defaultHeight: 160, tabs: [{ id: 'layers', label: 'Layers', render: () => <div className="demo-pane">Layers</div> }] },
]}
/>
</div>
)
}Props
DockArea
| Prop | Type | Default | Description |
|---|---|---|---|
kitrequired | string | — | Remembers the layout per kit, in the kit's store (kit:<kit>:dock, see kitStore). |
groupsrequired | readonly DockGroup[] | — | |
shownrequired | ReadonlySet<string> | — | Groups the Window menu shows; others are not drawn. |
onShownChange | (shown: ReadonlySet<string>) => void | — | |
width | number | — | |
handle | Ref<DockAreaHandle> | — | Receives the dock's DockAreaHandle. |
testId | string | 'dock' |
Used in
1 of Kition's 16 kits use this component.
Photo