Container Component

THIS PAGE
Introduction
Configuration Options
Triggers
Theme Options

Introduction

The container component can be used to group multiple components together. It also supports dynamic views, allowing different sets of component to be visible based on dynamic properties.

For example, you can create a card component to show details including an image, title and description.

Screenshot

Configuration Options

Auto Height

Expected Type: Boolean

If set to true, the container automatically adjusts the height based on it's contents.

Note: Manually changing the height in the layout settings has no effect when this is enabled.

Views

The container can show different sets of components based on the view set. This is useful to create permission based containers or zero states.

Screenshot

Creating a view

You can add more views by clicking the + View button in the container's configuration setting. Each view can be configured with the following properties:

Property Description Type Example
Title The title for the view, just used for readability within configurations. String Zero State
Key The key for this view. This is what's used to set the view dynamically String zeroState

Setting views dynamically

Views can be dynamically set through other components such as buttons and tabs. So, for example, we want to change the view on a button click.

  • Open the button configuration.
  • Add a Click action trigger.
  • For the action, select Control component.
  • For the component, select the container you want to switch the view for.
  • For the component property, select Container View.
  • Add the key for the view to set as the New Value.

Triggers

  • Click: Triggers whenever the chart is clicked.
  • Double Click: Triggers whenever the chart is clicked twice in quick succession.
  • Right Click: Triggers whenever the chart is right-clicked.
  • Mouse Enter: Triggers whenever the mouse starts hovering over the component.
  • Mouse Leave: Triggers whenever the mouse stops hovering over the component.

Theme Options

  • Shadow: The chart's shadow. (Shadow)
  • Border: The chart's border. You can also specify the radius for the edges. (Border)
  • Background Color: The chart's background color. (String | Hex)
Did you find what you were looking for?
👍
👎
What went wrong?
Need more help?We have a thriving Discordcommunity that can help you with all things Canonic. →