Logo

Dense mode

<v-treeview
  dense
  :items="items"
></v-treeview>

Dense mode provides more compact layout with decreased heights of the items.

Selectable

<v-treeview
  selectable
  :items="items"
></v-treeview>

You can easily select treeview nodes and children.

Searching a directory

<v-card
  class="mx-auto"
  max-width="500"
>
  <v-sheet class="pa-4 primary lighten-2">
    <v-text-field
      v-model="search"
      label="Search Company Directory"
      dark
      flat
      solo-inverted
      hide-details
      clearable
      clear-icon="mdi-close-circle-outline"
    ></v-text-field>
    <v-checkbox
      v-model="caseSensitive"
      dark
      hide-details
      label="Case sensitive search"
    ></v-checkbox>
  </v-sheet>
  <v-card-text>
    <v-treeview
      :items="items"
      :search="search"
      :filter="filter"
      :open.sync="open"
    >
      <template v-slot:prepend="{ item }">
        <v-icon
          v-if="item.children"
          v-text="`mdi-${item.id === 1 ? 'home-variant' : 'folder-network'}`"
        ></v-icon>
      </template>
    </v-treeview>
  </v-card-text>
</v-card>
Vuetify Human Resources
Core team

Custom selectable icons

<v-card>
  <v-toolbar
    color="primary"
    dark
    flat
  >
    <v-icon>mdi-silverware</v-icon>
    <v-toolbar-title>Local hotspots</v-toolbar-title>
  </v-toolbar>

  <v-row>
    <v-col>
      <v-card-text>
        <v-treeview
          v-model="tree"
          :load-children="fetch"
          :items="items"
          selected-color="indigo"
          open-on-click
          selectable
          return-object
          expand-icon="mdi-chevron-down"
          on-icon="mdi-bookmark"
          off-icon="mdi-bookmark-outline"
          indeterminate-icon="mdi-bookmark-minus"
        >
        </v-treeview>
      </v-card-text>
    </v-col>

    <v-divider vertical></v-divider>

    <v-col
      cols="12"
      md="6"
    >
      <v-card-text>
        <div
          v-if="tree.length === 0"
          key="title"
          class="title font-weight-light grey--text pa-4 text-center"
        >
          Select your favorite breweries
        </div>

        <v-scroll-x-transition
          group
          hide-on-leave
        >
          <v-chip
            v-for="(selection, i) in tree"
            :key="i"
            color="grey"
            dark
            small
            class="ma-1"
          >
            <v-icon left small>mdi-beer</v-icon>
            {{ selection.name }}
          </v-chip>
        </v-scroll-x-transition>
      </v-card-text>
    </v-col>
  </v-row>

  <v-divider></v-divider>

  <v-card-actions>
    <v-btn
      text
      @click="tree = []"
    >
      Reset
    </v-btn>

    <v-spacer></v-spacer>

    <v-btn
      class="white--text"
      color="green darken-1"
      depressed
    >
      Save
      <v-icon right>mdi-content-save</v-icon>
    </v-btn>
  </v-card-actions>
</v-card>

Customize the on, off and indeterminate icons for your selectable tree. Combine with other advanced functionality like API loaded items.

Local hotspots
Select your favorite breweries

Checkbox color

<v-treeview
  selectable
  selected-color="red"
  :items="items"
></v-treeview>

You can control the color of the selected node checkbox.

Slots

<v-treeview
  v-model="tree"
  :open="open"
  :items="items"
  activatable
  item-key="name"
  open-on-click
>
  <template v-slot:prepend="{ item, open }">
    <v-icon v-if="!item.file">
      {{ open ? 'mdi-folder-open' : 'mdi-folder' }}
    </v-icon>
    <v-icon v-else>
      {{ files[item.file] }}
    </v-icon>
  </template>
</v-treeview>

Using slots we are able to create an intuitive file explorer. Apart from the prepend slot, there is also one for the label, and an append slot.

public

Async items

<v-card>
  <v-card-title class="indigo white--text headline">
    User Directory
  </v-card-title>
  <v-row
    class="pa-4"
    justify="space-between"
  >
    <v-col cols="5">
      <v-treeview
        :active.sync="active"
        :items="items"
        :load-children="fetchUsers"
        :open.sync="open"
        activatable
        color="warning"
        open-on-click
        transition
      >
        <template v-slot:prepend="{ item, active }">
          <v-icon v-if="!item.children">mdi-account</v-icon>
        </template>
      </v-treeview>
    </v-col>

    <v-divider vertical></v-divider>

    <v-col
      class="d-flex text-center"
    >
      <v-scroll-y-transition mode="out-in">
        <div
          v-if="!selected"
          class="title grey--text text--lighten-1 font-weight-light"
          style="align-self: center;"
        >
          Select a User
        </div>
        <v-card
          v-else
          :key="selected.id"
          class="pt-6 mx-auto"
          flat
          max-width="400"
        >
          <v-card-text>
            <v-avatar
              v-if="avatar"
              size="88"
            >
              <v-img
                :src="`https://avataaars.io/${avatar}`"
                class="mb-6"
              ></v-img>
            </v-avatar>
            <h3 class="headline mb-2">
              {{ selected.name }}
            </h3>
            <div class="blue--text mb-2">{{ selected.email }}</div>
            <div class="blue--text subheading font-weight-bold">{{ selected.username }}</div>
          </v-card-text>
          <v-divider></v-divider>
          <v-row
            class="text-left"
            tag="v-card-text"
          >
            <v-col class="text-right mr-4 mb-2" tag="strong" cols="5">Company:</v-col>
            <v-col>{{ selected.company.name }}</v-col>
            <v-col class="text-right mr-4 mb-2" tag="strong" cols="5">Website:</v-col>
            <v-col>
              <a :href="`//${selected.website}`" target="_blank">{{ selected.website }}</a>
            </v-col>
            <v-col class="text-right mr-4 mb-2" tag="strong" cols="5">Phone:</v-col>
            <v-col>{{ selected.phone }}</v-col>
          </v-row>
        </v-card>
      </v-scroll-y-transition>
    </v-col>
  </v-row>
</v-card>
User Directory
Select a User