DashboardResizeHandle

GitHub
A handle to resize a sidebar or panel.

Usage

The DashboardResizeHandle component is used by the DashboardSidebar and DashboardPanel components.

It is automatically displayed when the resizable prop is set, you don't have to add it manually.

Examples

Within resize-handle slot

Even though this component is automatically displayed when the resizable prop is set, you can use the resize-handle slot of the DashboardSidebar and DashboardPanel components to customize the handle.

<template>
  <PDashboardGroup>
    <PDashboardSidebar resizable>
      <template #resize-handle="{ onMouseDown, onTouchStart, onDoubleClick }">
        <PDashboardResizeHandle
          class="hover:after:bg---ui-border-accented after:w-px after:transition after:inset-y-0 after:right-0 after:absolute"
          @mousedown="onMouseDown"
          @touchstart="onTouchStart"
          @dblclick="onDoubleClick"
        />
      </template>
    </PDashboardSidebar>

    <slot />
  </PDashboardGroup>
</template>
In this example, we add an after pseudo-element to display a vertical line on hover.

API

Props

Prop Default Type

Slots

Slot Type

Theme

We use unocss-variants to customize the theme. Read more about it in the theming guide.

Below is the theme configuration skeleton for the PDashboardResizeHandle. Since the component is provided unstyled by default, you will need to fill in these values to apply your own custom look and feel. If you prefer to use our pre-built, opinionated styling, you can instead use our UnoCSS preset, this docs is using it as well.

app.config.ts
export default defineAppConfig({
  pohon: {
    dashboardResizeHandle: {
      base: ''
    }
  }
};
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'

export default defineAppConfig({
  pohon: {
    dashboardResizeHandle: {
      base: ''
    }
  }
};

Changelog

No recent changes