Overlays

VSheet

Componentev-model10 exemplos18 propsA2UI · Sheet

Superfície edge-attached que desliza da borda para tarefas focadas (settings, details, creation flows), sem tirar o usuário do contexto. Light Mode como referência principal.

Importação
<script setup lang="ts">
import { VSheet } from 'vueui-nova-kit'
</script>

Uso

Exemplo
<script setup lang="ts">

</script>

<template>
  
</template>

Playground

Os controles abaixo são gerados a partir das props declaradas em VSheet.types.ts; o código acompanha cada mudança.

Exemplos

Variantes, tamanhos e estados, extraídos das stories da biblioteca.

Default

Painel lateral sobre a página, para editar ou detalhar algo sem sair do contexto. Cabeçalho com título, descrição e fechar; ações principais no #footer.

Ver código
vue
<script setup lang="ts">
import { ref } from 'vue'
import { VSheet, VTextInput, VTextarea, VSwitch, VButton } from 'vueui-nova-kit'

const args = {
  open: true,
  side: 'right',
  size: 'md',
  title: 'Project settings',
  description: 'Manage your project details.'
}
const name = ref('Design System')
const about = ref('')
const isPublic = ref(true)
</script>

<template>
      <VSheet v-bind="args">
        
  <VTextInput v-model="name" label="Project name" />
  <VTextarea v-model="about" label="Description" placeholder="What is this project about?" />
  <VSwitch v-model="isPublic" label="Visible to everyone in the workspace" />
        <template #footer>
          <VButton variant="ghost">Cancel</VButton>
          <VButton>Save changes</VButton>
        </template>
      </VSheet>
</template>

Sides

side: right (padrão), left, bottom e top. Escolha um lado para abrir.

Ver código
vue
<script setup lang="ts">
import { ref } from 'vue'
import { VButton, VSheet } from 'vueui-nova-kit'

const open = ref(false)
const side = ref('right')
const show = (s) => {
        side.value = s;
        open.value = true;
      }
</script>

<template>
  <div style="display:flex;gap:8px;padding:24px;flex-wrap:wrap">
    <VButton variant="outline" @click="show('right')">Right</VButton>
    <VButton variant="outline" @click="show('left')">Left</VButton>
    <VButton variant="outline" @click="show('bottom')">Bottom</VButton>
    <VButton variant="outline" @click="show('top')">Top</VButton>
  </div>
  <VSheet v-model:open="open" :side="side" title="Filters" description="Narrow down the results.">
    <p style="margin:0;color:var(--v-color-text-muted)">Sheet content.</p>
  </VSheet>
</template>

Sizes

size: sm 320px, md 480px, lg 640px e xl 800px. Escolha um tamanho para abrir.

Ver código
vue
<script setup lang="ts">
import { ref } from 'vue'
import { VButton, VSheet } from 'vueui-nova-kit'

const open = ref(false)
const size = ref('md')
const show = (s) => {
        size.value = s;
        open.value = true;
      }
</script>

<template>
  <div style="display:flex;gap:8px;padding:24px;flex-wrap:wrap">
    <VButton variant="outline" @click="show('sm')">Small · 320</VButton>
    <VButton variant="outline" @click="show('md')">Medium · 480</VButton>
    <VButton variant="outline" @click="show('lg')">Large · 640</VButton>
    <VButton variant="outline" @click="show('xl')">Extra large · 800</VButton>
  </div>
  <VSheet v-model:open="open" :size="size" title="Sheet size" :description="'size=&quot;' + size + '&quot;'">
    <p style="margin:0;color:var(--v-color-text-muted)">Sheet content.</p>
  </VSheet>
</template>

With Header Actions

Slot #actions: ações extras no cabeçalho, ao lado do fechar (aqui, um VButton de ícone).

Ver código
vue
<script setup lang="ts">
import { ref } from 'vue'
import { VSheet, VButton, VIcon, VTextInput, VTextarea, VSwitch } from 'vueui-nova-kit'

const args = {
  open: true,
  side: 'right',
  size: 'md',
  title: 'Project settings',
  description: 'Manage your project details.'
}
const moreIcon = {
  width: 24,
  height: 24,
  body: '<path fill=\'currentColor\' d=\'M7 12C7 13.1045 6.1045 14 5 14C3.8955 14 3 13.1045 3 12C3 10.8955 3.8955 10 5 10C6.1045 10 7 10.8955 7 12ZM14 12C14 13.1045 13.1045 14 12 14C10.8955 14 10 13.1045 10 12C10 10.8955 10.8955 10 12 10C13.1045 10 14 10.8955 14 12ZM21 12C21 13.1045 20.1045 14 19 14C17.8955 14 17 13.1045 17 12C17 10.8955 17.8955 10 19 10C20.1045 10 21 10.8955 21 12Z\'/>'
}
const name = ref('Design System')
const about = ref('')
const isPublic = ref(true)
</script>

<template>
      <VSheet v-bind="args">
        <template #actions>
          <VButton variant="icon" size="sm" aria-label="More options"><template #icon><VIcon :icon="moreIcon" size="sm" /></template></VButton>
        </template>
        
  <VTextInput v-model="name" label="Project name" />
  <VTextarea v-model="about" label="Description" placeholder="What is this project about?" />
  <VSwitch v-model="isPublic" label="Visible to everyone in the workspace" />
        <template #footer>
          <VButton variant="ghost">Cancel</VButton>
          <VButton>Save changes</VButton>
        </template>
      </VSheet>
</template>

Full Height

fullHeight com side="bottom": ocupa a altura toda, para fluxos imersivos.

Ver código
vue
<script setup lang="ts">
import { VSheet } from 'vueui-nova-kit'

const args = {
  open: true,
  side: 'bottom',
  size: 'md',
  title: 'Import data',
  description: 'Map your columns before importing.',
  fullHeight: true
}
</script>

<template>
  <VSheet v-bind="args"><p style="margin:0;color:var(--v-color-text-muted)">Sheet content.</p></VSheet>
</template>

Loading

loading=true.

Ver código
vue
<script setup lang="ts">
import { VSheet } from 'vueui-nova-kit'
</script>

<template>
  <VSheet
    v-model="value"
    open
    title="Project settings"
    description="Manage your project details."
    loading />
</template>

Disabled

disabled=true.

Ver código
vue
<script setup lang="ts">
import { VSheet } from 'vueui-nova-kit'
</script>

<template>
  <VSheet
    v-model="value"
    open
    title="Project settings"
    description="Manage your project details."
    disabled />
</template>

No Close Button

showClose=false: feche por Esc, pelo backdrop ou por uma ação do rodapé.

Ver código
vue
<script setup lang="ts">
import { VSheet } from 'vueui-nova-kit'
</script>

<template>
  <VSheet
    v-model="value"
    open
    title="Project settings"
    description="Manage your project details."
    :show-close="false" />
</template>

Not Dismissible

dismissible=false: backdrop e Esc não fecham; só o botão de fechar ou uma ação.

Ver código
vue
<script setup lang="ts">
import { VSheet } from 'vueui-nova-kit'
</script>

<template>
  <VSheet
    v-model="value"
    open
    title="Project settings"
    description="Manage your project details."
    :dismissible="false" />
</template>

Controlled Open

Abertura controlada com v-model:open; fecha por Esc, backdrop ou pelo botão.

Ver código
vue
<script setup lang="ts">
import { ref } from 'vue'
import { VButton, VSheet } from 'vueui-nova-kit'

const args = {
  open: true,
  side: 'right',
  size: 'md',
  title: 'Project settings',
  description: 'Manage your project details.'
}
const open = ref(false)
</script>

<template>
  <div style="padding:24px"><VButton @click="open = true">Open sheet</VButton></div>
  <VSheet v-bind="args" v-model:open="open">
    <p style="margin:0;color:var(--v-color-text-muted)">Sheet content.</p>
    <template #footer><VButton @click="open = false">Done</VButton></template>
  </VSheet>
</template>

Acessibilidade

Segue o padrão dialog WAI-ARIA: role="dialog" + aria-modal="true", título como heading (h2) ligado via aria-labelledby (+ aria-describedby via description; ariaLabel/ariaDescribedby como override), focus-trap dialog padrão (Tab/Shift+Tab circulam presos, foco inicial no primeiro focável), Escape + backdrop dispensável fecham (dismissible), retorno de foco ao fechar, backdrop acessível com fechamento por clique.

Estados

data-state expõe o ciclo closed → opening → open → closing durante transições Vue (v-sheet-surface). Interativos internos seguem hover/focus/pressed do sistema. Estados adicionais: disabled, loading.

Motion

TriggerPropertyDurationEasing
Slide in (open)transform/opacity--v-motion-normal (≈200ms)--v-ease-out
Slide out (close)transform/opacity--v-motion-card-hover (150ms)--v-ease-in
Backdrop fadeopacity--v-motion-normal--v-ease-out
Close button focusoutline--v-motion-fast--v-ease-standard

Respeitar prefers-reduced-motion (slide/transições neutralizados).

Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.

Props

PropTipoDefaultDescrição
openbooleanundefinedControls visibility. `v-model:open` (primary) — `modelValue` accepted as alias.
modelValuebooleanundefined—
sideVSheetSide"right"Edge the sheet slides in from.
sizeVSheetSize"md"Width preset for side sheets (sm 320 / md 480 / lg 640 / xl 800).
fullHeightbooleanfalseImmersive full-viewport height (bottom → 100vh; side sheets keep edge-to-edge height).
titlestringundefined—
descriptionstringundefined—
showClosebooleantrue—
closeLabelstring"Close sheet"—
dismissiblebooleantrueBackdrop click + Escape dismiss the sheet.
disabledbooleanfalse—
loadingbooleanfalse—
ariaLabelstringundefined—
ariaDescribedbystringundefined—
rootClassstringundefinedOptional root/surface class for composed surfaces (e.g. VDrawer).
surfaceClassstringundefined—
testIdsVSheetTestIdsundefined—
rootDataAttrsRecord<string, string | undefined>undefinedExtra data-* attributes on the root wrapper (for composed surfaces like VDrawer).

Events

EventoPayloadDescrição
@update:openvalue: boolean—
@update:modelValuevalue: boolean—
@open-changevalue: boolean—
@close——
@dismiss——

Slots

SlotProps do slot
#title—
#header—
#description—
#actions—
#close—
#prepend—
#default—
#footer—

Fonte: src/components/containment/VSheet/VSheet.vue · tipos: src/components/containment/VSheet/VSheet.types.ts