# Components
`dj-angles` provides component-like functionality by enhancing Django's built-in `include` template tag.
## Includes
These are equivalent ways to include HTML files.
```text
```
```{note}
The self-closing element is used in most examples, but explicit closing elements for all examples, e.g. ``, also works.
```
They all compile to the following Django template.
```html
{% include 'partial.html' %}
```
The wrapping element, e.g. `dj-partial`, is a custom element which browsers will ignore. It allows for easier debugging when looking at the source code and also allows for targeted CSS styling.
```{warning}
The built-in [tags](tag-elements.md) are considered reserved words. Template file names that conflict will not get loaded because reserved words take precedence. For example, if there is a template named "extends.html" `` could not be used to include it; `` would need to be used instead.
```
### Underscored files
Underscores are used as a convention for partials in some frameworks, so that is supported in `dj-angles`. The following would first look for `partial.html`. If it could not be found, it would then look for `_partial.html`.
```html
```
### Wrapping element key
Adding a colon and an identifier to the end of a template name allows for even more specific CSS styling.
```html
```
Would get compiled to the following Django template.
```html
{% include 'partial.html' }
```
### Directories
Accessing templates in directories is supported even though technically forward-slashes [aren't permitted in a custom element](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name). It might confound HTML syntax highlighters.
```text
```
They all compile to the following Django template.
```html
{% include 'directory/partial.html' %}
```
## CSS scoping
To encapsulate component styles, the `dj-angles` can use the Shadow DOM. This will ensure that any `style` element in the include will be contained. The downside is that the Shadow DOM does not allow outside styles in (other than CSS variables).
These are all equivalent ways to use the Shadow DOM with an include.
```text
```
They all compile to the following Django template syntax.
```html
{% include 'partial.html' %}
```
**More information about the Shadow DOM**
- Shadow DOM styling: https://javascript.info/shadow-dom-style
- Declaratively creating a shadow root: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#shadowrootmode
- Using the Shadow DOM: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM
## Slots
```{note}
Currently in beta and disabled by default. Can be enabled by [setting `slots_enabled` to `True`](settings.md#slots_enabled).
```
Slots designate certain sections of an include template as placeholders. Those placeholders can then be "filled-in" with HTML when the component is rendered.
```html
User One
```
```html
Profile
```
Would be rendered as the following.
```html
Profile
Profile
```
## Integrations
For other approaches to components in Django, `dj-angles` integrates with other Django component libraries. The currently supported external libraries include:
- [`django-bird`](integrations/django-bird.md)