Skip to content

Drawer

Painel que sobe de baixo da tela. Ideal para ações contextuais, filtros e confirmações — especialmente em mobile.

Exemplos

Básico

vue
<script setup lang="ts">
import { Drawer, Button } from '@halfbyte/maka'
import { ref } from 'vue'

const aberto = ref(false)
</script>

<template>
  <Button @click="aberto = true">Abrir drawer</Button>

  <Drawer v-model="aberto" title="Move Goal" description="Set your daily activity goal.">
    <p>Conteúdo do drawer.</p>

    <template #footer>
      <Button style="width:100%">Submit</Button>
      <Button variant="outline" style="width:100%">Cancel</Button>
    </template>
  </Drawer>
</template>

Tamanhos

vue
<Drawer size="sm">…</Drawer>
<Drawer size="md">…</Drawer>
<Drawer size="lg">…</Drawer>
<Drawer size="full">…</Drawer>

Props

PropTipoPadrão
modelValuebooleanfalse
titlestring
descriptionstring
size"sm" | "md" | "lg" | "full""md"
closablebooleanfalse

Alturas por tamanho

SizeAltura máxima
sm35vh
md55vh
lg75vh
full100dvh

Slots

SlotDescrição
defaultCorpo do drawer
headerSubstitui o header padrão (título + descrição)
footerRodapé — botões em coluna, full-width

Events

EventoPayloadDescrição
update:modelValuebooleanEmitido ao abrir/fechar drawer