Skip to content

useMongocampUi ​

The module's look: which size, colour and variant the components give their buttons, inputs, alerts, badges and dialogs. Set it under nuxtUiMongocamp.ui in app.config.ts — see Theming. This composable reads it back, merged over the defaults.

ts
const ui = useMongocampUi() // ComputedRef<MongocampUiTheme>
ui.value.iconButton // { color: 'neutral', variant: 'ghost', size: 'sm' }

It is reactive: after updateAppConfig({ nuxtUiMongocamp: { ui: { … } } }) the module's components restyle without a reload. Values that are not text, and keys the module does not know, are ignored.

Use it to give a button of your own the same look as the module's:

vue
<script setup lang="ts">
const ui = useMongocampUi()
</script>

<template>
  <MongocampUsers>
    <template #toolbar>
      <UButton v-bind="ui.toolbarButton" icon="i-lucide-download" label="Export" />
    </template>
  </MongocampUsers>
</template>
  • Theming — the roles, their defaults and the class names of the components

Released under the MIT License.