# Props defaults

Component props such as `size`, `color`, `variant`, etc., have default values that can be overridden in the project's `vueless.config.{js,ts}`.

<pre class="language-js" data-title="vueless.config.{js,ts}"><code class="lang-js">export default {
  component: {
    UButton: {
<strong>      defaults: {
</strong><strong>        size: "lg",
</strong><strong>        color: "red",
</strong><strong>        variant: "secondary"
</strong><strong>      }
</strong>    }
  }
};
</code></pre>

## Nested component defaults

The `config` prop can also be used to redefine default prop values. In practice, this is useful for changing default values of nested components.

<pre class="language-html"><code class="lang-html">&#x3C;UPagination 
  label="Submit" 
  :config="{ 
    activeButton: {
<strong>      defaults: { 
</strong><strong>        size: 'xl', 
</strong><strong>        color: 'blue'
</strong><strong>      } 
</strong>    }
  }"
/>
</code></pre>

In the example above, we redefine the default values for the nested `UButton` component within the parent `UPagination` component.

## Conditional default values

If you need to set default values for nested components based on the parent component’s prop value, you can use an object with mapped values.

<pre class="language-js" data-title="vueless.config.{js,ts}"><code class="lang-js">export default {
  component: {
    UDropdownButton: {
      dropdownList: {
        defaults: {
<strong>          size: {
</strong><strong>            "2xs": "sm",
</strong><strong>            xs: "sm",
</strong><strong>            sm: "sm",
</strong><strong>            md: "md",
</strong><strong>            lg: "lg",
</strong><strong>            xl: "lg",
</strong><strong>          }
</strong>        }
      }
    }
  }
};
</code></pre>

This will conditionally set the size for the `UDropdownList` component based on the size value of the `UDropdownButton` component.&#x20;

For example, if the UDropdownButton’s size prop is set to `"2xs"`, the UDropdownList component will automatically receive a size value of `"sm"`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vueless.com/component-customization/props-defaults.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
