primevue-mirror/apps/volt/doc/button/HeadlessDoc.vue

41 lines
1.5 KiB
Vue
Raw Normal View History

2025-03-04 10:12:57 +00:00
<template>
<DocSectionText v-bind="$attrs">
2025-03-04 11:17:02 +00:00
<p>Headless mode is enabled by adding the <i>asChild</i> property and defining your own UI element with the available bindings.</p>
2025-03-04 10:12:57 +00:00
</DocSectionText>
<div class="card flex justify-center">
2025-03-04 11:17:02 +00:00
<Button v-slot="slotProps" asChild>
<button
v-bind="slotProps.a11yAttrs"
class="rounded-lg bg-gradient-to-br from-primary-400 to-primary-700 active:from-primary-700 active:to-primary-900 text-white border-none px-6 py-3 font-bold hover:ring-2 cursor-pointer ring-offset-2 ring-offset-surface-0 dark:ring-offset-surface-900 ring-primary transition-all"
>
SIGN UP
</button>
</Button>
2025-03-04 10:12:57 +00:00
</div>
<DocSectionCode :code="code" />
</template>
<script setup>
import Button from '@/volt/button';
import { ref } from 'vue';
const code = ref(`
<template>
<div class="card flex justify-center">
2025-03-04 11:17:02 +00:00
<Button v-slot="slotProps" asChild>
<button
v-bind="slotProps.a11yAttrs"
class="rounded-lg bg-gradient-to-br from-primary-400 to-primary-700 active:from-primary-700 active:to-primary-900 text-white border-none px-6 py-3 font-bold hover:ring-2 cursor-pointer ring-offset-2 ring-offset-surface-0 dark:ring-offset-surface-900 ring-primary transition-all"
>
SIGN UP
</button>
</Button>
2025-03-04 10:12:57 +00:00
</div>
</template>
<script setup>
import Button from '@/volt/button';
<\/script>
`);
</script>