Skip to content

Towser Component

Unlike a modal, when lots of data needs to be included within a create/ edit

Props

Prop NameTypeDefaultDescription
showbooleanfalseControls visibility of the tabulator.
titlearray[]Array of breadcrumb titles with optional links.
actionsarraynullButtons in the footer, each with title, emit event, and optional class.
doublebooleanfalseEnables a two-column layout inside the tabulator.
bodyWidthnumber50Width of the first column when double is true.
body2Widthnumber50Width of the second column when double is true.

Slots

NameDescription
defaultMain content inside the tabulator.
body2Second column content (used when double is true).

Emits

Event NameDescription
onCloseCloses the tabulator.
saveActionTriggers when the save button is clicked (if provided in actions).

Functions

Function NameDescription
emit('onClose')Closes the tabulator.
emit('saveAction')Calls the save action when triggered.

Usage

Basic Usage

vue
<Towser
    :show="showModal"
    :title="[{ name: 'Home', link: '/' }, { name: 'Settings' }]"
    :actions="[{ title: 'Close', emit: 'onClose' }]"
    @onClose="showModal = false"
>
    <p>This is the content of the modal.</p>
</Towser>

Example with Two Columns

vue
<Towser
    :show="showTab"
    :double="true"
    :title="[{ name: 'Dashboard' }, { name: 'Details' }]"
    :actions="[
        { title: 'Cancel', emit: 'onClose' },
        { title: 'Save', emit: 'saveAction', class: 'btn' }
    ]"
    @onClose="showTab = false"
    @saveAction="handleSave"
>
    <template #default>
        <p>This is the main content.</p>
    </template>
    <template #body2>
        <p>This is the second column.</p>
    </template>
</Towser>

Screenshot

towser image


Notes

  • The component uses a slide-in transition (.towser-enter-active).
  • The header dynamically generates breadcrumb navigation.
  • If double is true, it automatically creates a split-pane layout.
  • Can be customized for different modal sizes.
  • If called in as a child component, pass a true in the :showTab and emit a false to open/close