`nova-trame` provides several key components that simplify UI development. Here are some of the most important:
***Layout & Theme Management (`ThemedApp`):**`nova-trame` provides a default layout and theme that will give your application a consistent look and feel to other NOVA applications. If needed, you can still customize or override the defaults.
***`InputField`:** This component simplifies the creation of various input fields (text fields, dropdowns, checkboxes, etc.). It automatically integrates with Pydantic models to load labels, hints, and validation rules, reducing the amount of code you need to write. It also supports debouncing and throttling for improved performance.
***Layout Components:**`nova-trame` provides layout components that help you structure your UI. These components are based on CSS Flexbox and Grid layouts, making it easy to create responsive and visually appealing UIs. The main layout components include:
***`GridLayout`:** Creates a grid with a specified number of columns. You can use `GridLayout` to arrange your UI elements in a structured grid layout.
@@ -67,6 +68,32 @@ Benefits of using `nova-trame`:
Let\'s explore these components in more detail:
### Layout & Theme Management (`ThemedApp`)
Layouts are responsible for arraging your content in a consistent manner. In Trame, a layout consists of multiple "slots". A slot is a section of the page to which you can add content.
`nova-trame` provides a basic layout and theme that you can access via the `ThemedApp` class. The template app will setup your main view class to inherit from this class already, so let's look at how the layout is defined and how we can add content to one of the slots it provides.
```python
classMainApp(ThemedApp):
defcreate_ui(self)->None:
withsuper().create_ui()aslayout:
withlayout.pre_content:
withvuetify.VTabs():
vuetify.VTab("Tab 1")
vuetify.VTab("Tab 2")
withlayout.content:
vuetify.VBtn("Click Me!")
```
Here is a layout diagram showing all of the slots in `ThemedApp`:

::::::::::::::::::::::::::::::::::::::::: callout
For a detailed discussion of how to work with these slots, please review the [`nova-trame` documentation](https://nova-application-development.readthedocs.io/projects/nova-trame/en/stable/working_with_trame.html). This documentation also shows you how to customize the theme provided by `nova-trame` and how to perform common UI tasks such as managing the spacing between elements.
:::::::::::::::::::::::::::::::::::::::::::::::::
### `InputField`
The `InputField` component simplifies creating different types of input fields in your UI. It can create text fields, dropdowns (select), checkboxes, and more, all with a consistent look and feel. A key advantage of `InputField` is its automatic integration with Pydantic models. If the `v_model` references a Pydantic model field, `InputField` can automatically:
@@ -127,11 +154,13 @@ The `InputField` also provides debouncing and throttling features that can impro
By combining these layout components, you can create complex and responsive UI layouts.
For a more detailed explanation of how to work with our layout and theme, please refer to the [`nova-trame documentation`](https://nova-application-development.readthedocs.io/projects/nova-trame/en/stable/working_with_trame.html).
## Adding More UI Components to the Sample Tabs
Now, let\'s add some UI components to the Sample Tabs in our application to demonstrate how to use these components. We\'ll modify the `sample_tab_1.py` and `sample_tab_2.py` files to include these components.