# Component Registry

Since version 1.0.0, components need to be registered in a registry file:

## Custom component registry

Create a registry module like:

`APP_ROOT/app/matestack/components/registry.rb`

```ruby
module Components::Registry

  Matestack::Ui::Core::Component::Registry.register_components(
    #...
    some_component: Some::Component,
    #...
  )

end
```

and make sure to include this module in your base controller like:

```ruby
class ApplicationController < ActionController::Base

  include Matestack::Ui::Core::ApplicationHelper
  include Components::Registry

end
```

The registered DSL method `some_component` does NOT have to match namespace structure of the component class. (but it could if you like to, as shown in the example above)

*Note*

Please be aware that once the component registry was loaded, the initially registered dsl\_methods are cached. Removing a dsl\_method from the registry will not have an effect until the server gets reloaded. Added dsl\_methods however will be available without having to restart the server.


---

# 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.matestack.io/matestack-ui-core/1.5.0/ui-components/component-registry.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.
