Skip to content
On this page

NcAppSidebar

Props

Prop nameDescriptionTypeValuesDefault
activestring-''
titlestring-''
titleEditableAllow to edit the sidebar title.boolean-false
titlePlaceholderstring-''
subtitlestring-''
subtitleTooltipstring-''
backgroundUrl to the top header background image
Applied with css
string-''
starredEnable the favourite icon if not null
See fired events
boolean-null
starLoadingShow loading spinner instead of the star iconboolean-false
loadingShow loading spinner instead of tabsboolean-false
compactDisplay the sidebar in compact modeboolean-false
emptyOnly display close button and default slot content.
Don't display other header content and primary and secondary actions.
Useful when showing the EmptyContent component as content.
boolean-false
forceMenuForce the actions to display in a three dot menuboolean-false
linkifyTitleLinkify the titleboolean-false
titleTooltipTooltip to display for the title.
Can be set to the same text in case it's too long.
string-''

Events

Event namePropertiesDescription
closeThe user clicked to closed the sidebar
closingThe sidebar is closing and the transition is in progress
closedThe sidebar is closed and the transition is complete
openingThe sidebar is opening and the transition is in progress
openedThe sidebar is opened and the transition is complete
figure-clickThe figure/background header has been clicked
update:starredEmitted when the starred value changes
update:titleEditableEmitted when the titleEditable value changes
update:titleEmitted when the title value changes
update:activeThe active tab changed
submit-titleEmitted when the title edit input has been submitted
dismiss-editingEmitted when the title edit has been cancelled

Slots

NameDescriptionBindings
header
tertiary-actions
secondary-actions
description
default

General description

This component provides a way to include the standardised sidebar. The standard properties like title, subtitle, starred, etc. allow to automatically include a standard-header like it's used by the files app.

Standard usage

vue
<template>
  <NcAppSidebar title="cat-picture.jpg" subtitle="last edited 3 weeks ago">
    <NcAppSidebarTab icon="icon-settings" name="Settings" id="settings-tab">
      <template #icon>
        <Cog :size="20" />
      </template>
      Settings tab content
    </NcAppSidebarTab>
    <NcAppSidebarTab icon="icon-share" name="Sharing" id="share-tab">
      Sharing tab content
    </NcAppSidebarTab>
  </NcAppSidebar>
</template>
<script>
import Cog from "vue-material-design-icons/Cog";

export default {
  components: {
    Cog
  }
};
</script>

Editable title

vue
<template>
  <NcAppSidebar
    :title.sync="title"
    :title-editable="true"
    title-placeholder="Filename"
    subtitle="last edited 3 weeks ago"
  >
    <!-- Insert your slots and tabs here -->
  </NcAppSidebar>
</template>
<script>
export default {
  data() {
    return {
      title: "cat-picture.jpg"
    };
  }
};
</script>

Editable title after click with custom tertiary action

vue
<template>
  <NcAppSidebar
    :title="title"
    :title-editable.sync="titleEditable"
    :title-placeholder="titlePlaceholder"
    :subtitle="subtitle"
    @update:title="titleUpdate"
  >
    <template #tertiary-actions>
      <form>
        <input type="checkbox" @click="toggledCheckbox" />
      </form>
    </template>
  </NcAppSidebar>
</template>
<script>
export default {
  data() {
    return {
      title: "cat-picture.jpg",
      titlePlaceholder: "Filename",
      subtitle: "last edited 3 weeks ago",
      titleEditable: false
    };
  },
  methods: {
    titleUpdate(e) {
      this.title = e;
    },
    toggledCheckbox() {
      alert("toggle");
    }
  }
};
</script>

Empty sidebar for e.g. empty content component.

vue
<template>
  <NcAppSidebar title="cat-picture.jpg" :empty="true">
    <NcEmptyContent icon="icon-search">
      Content not found.
    </NcEmptyContent>
  </NcAppSidebar>
</template>

NcAppSidebarTabs

Props

Prop nameDescriptionTypeValuesDefault
activeId of the tab to activatestring-''

Events

Event namePropertiesDescription
update:active

Slots

NameDescriptionBindings
default