# UI Library

> Directus offers globally-registered UI components for building extensions.

Directus offers reusable UI components for building extensions, providing a consistent user experience across the Directus Data Studio. These components are used by Directus itself and can be utilized in any extension without explicit imports.

Explore the available components in our [Directus Components Playground](https://components.directus.io/). Here, you can
see all available components and experiment with variations before implementing them in your extensions.

![Exploring the Button Component and its variations on the Directus UI Components Playground](/img/f113fff5-aeda-4ee6-a390-88649c5a26a6.gif)

## Extension Usage

Directus UI components are globally registered, making them accessible throughout your extension project without the
need for explicit imports. Here’s an example:

```html
<VButton>My Button</VButton>
```

## Customizing Styles

Each component exports CSS custom properties (variables) that can be targeted for style overrides.

For example, to adjust the text color of a button on hover:

```vue
<template>
    <!-- give the button a class -->
    <VButton class="my-button">My Button</VButton>
</template>

<style>
/* customize the style */
.my-button {
    --v-button-color-hover: black;
}
</style>
```

<callout icon="i-lucide-info">

**Explore Component CSS Variables**<br />


Refer to the full list of component based CSS variables [in our source code](https://github.com/directus/directus/tree/main/app/src/components).

</callout>

## Creating a Custom UI Component

The Directus UI components are designed with flexibility and customization in mind. However, you may need to create your
own components using shared styling. Directus exposes several CSS variables for both light and dark themes.

Examples of CSS variables include `--theme--border-normal`, `--theme--foreground-normal` `--theme--purple`, `--theme--module-background`, and
`--theme--overlay-color`.

<callout icon="i-lucide-info">

**Explore Light and Dark Theme CSS Variables**<br />


Refer to our [source code](https://github.com/directus/directus/tree/main/app/src/styles/themes) for a full list of CSS
variables.

</callout>
