# Components `Unicorn` uses the term "component" to refer to a set of interactive functionality. A component consists of a Python [`view`](views.md) class which provides the backend code and a Django HTML [`template`](templates.md). ## Create a component The easiest way to create your first component is to run the `startunicorn` Django management command after `Unicorn` is installed. The first argument to `startunicorn` is the Django app to add your component to. Every argument after the first is the name of a component to create. ```shell # Create `hello-world` and `hello-magic` components in `myapp` python manage.py startunicorn myapp hello-world hello-magic ``` That would create a file structure like the following: ``` myapp/ components/ __init__.py hello_world.py hello_magic.py templates/ myapp/ hello-world.html hello-magic.html ``` ```{warning} Make sure that the app name specified is in the `INSTALLED_APPS` list in your Django settings file (normally `settings.py`). ``` ## Use a component Components usually reside in a regular Django template (unless it is a [direct view](direct-view.md)). The component is "included" (similar to the `include` templatetag) with a `unicorn` templatetag. ```html {% load unicorn %} {% csrf_token %} {% unicorn 'hello-world' %} ``` ## A basic component An example component consists of the following Python view class and HTML template. ```python # hello_world.py from django_unicorn.components import UnicornView class HelloWorldView(UnicornView): name = "World" ``` ```html