primevue-mirror/apps/showcase/doc/theming/styled/customization/DefinePresetDoc.vue

33 lines
828 B
Vue
Raw Normal View History

2024-03-30 23:15:56 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>The <i>definePreset</i> utility is used to customize an existing preset during the PrimeVue setup. The first parameter is the preset to customize and the second is the design tokens to override.</p>
</DocSectionText>
<DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
import PrimeVue from 'primevue/config';
2024-06-11 12:21:12 +00:00
import { definePreset } from '@primevue/themes';
import Aura from '@primevue/themes/aura';
2024-03-30 23:15:56 +00:00
const MyPreset = definePreset(Aura, {
//Your customizations, see the following sections for examples
});
app.use(PrimeVue, {
theme: {
preset: MyPreset
}
});
`
}
};
}
};
</script>