components/ReorderTabs
import { … } from 'zidane-ui'ui/src/components/ReorderTabs.tsx
Components#
ReorderTabsComponent#
Renders the reorderable tab strip (see the module comment).
function ReorderTabs(props: ReorderTabsProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ReorderTabsProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| activeId | string | null | The selected tab, scrolled into view; |
| className? | string | Extra classes on the strip. |
| ids | readonly string[] | The tabs, in their current order. |
| label | string | Accessible name of the tablist. |
| onReorder | (ids: readonly string[]) => void | The new order, once per drop or keyboard move. |
| renderTab | (id: string, state: ReorderTabState) => ReactNode | Draws one tab (a |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
ReorderTabsPropsInterface#
Props of ReorderTabs.
interface ReorderTabsPropsProperties
| Name | Type | Description |
|---|---|---|
| activeId | string | null | The selected tab, scrolled into view; |
| className? | string | Extra classes on the strip. |
| ids | readonly string[] | The tabs, in their current order. |
| label | string | Accessible name of the tablist. |
| onReorder | (ids: readonly string[]) => void | The new order, once per drop or keyboard move. |
| renderTab | (id: string, state: ReorderTabState) => ReactNode | Draws one tab (a |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
ReorderTabStateInterface#
What a tab needs to take part in the strip.
interface ReorderTabStateProperties
| Name | Type | Description |
|---|---|---|
| lifted | boolean | Held by the pointer. |
| onMove | (delta: number) => void | Moves the tab one slot left (-1) or right (+1). |
| pick | (run: () => void) => () => void | Wraps the tab's pick, so the click that ends a drag doesn't pick. |