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

35 lines
908 B
Vue

<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';
import { definePreset } from 'primevue/themes';
import PrimeOne from 'primevue/themes/primeone';
import Aura from 'primevue/themes/primeone/aura';
const MyPreset = definePreset(Aura, {
//Your customizations, see the following sections for examples
});
app.use(PrimeVue, {
theme: {
base: PrimeOne,
preset: MyPreset
}
});
`
}
};
}
};
</script>