Skip to main content
Version: v3.0

Field Groups

Field groups render individual form inputs, labels and a feedback component for a model attribute on the edit and create pages. They are used in the ModelEditForm and ModelCreateForm components.

The complete list of field group components is below.

Layout​

The default layout is vertical. The other layouts are horizontal and floating. Individual fields can be configured to use a different layout by explicitly using the ModelFieldGroup variant ie <ModelFieldGroupHorizontal model="blog" path="title".

Global horizontal layout​

const rhinoConfig = {
version: 1,
components: {
ModelFieldGroup: ModelFieldGroupHorizontal
}
}

Global floating layout​

const rhinoConfig = {
version: 1,
components: {
ModelFieldGroup: ModelFieldGroupFloating
}
}

Field behaviour​

Change label​

const rhinoConfig = {
version: 1,
components: {
ModelFieldGroup: { props: { label: 'Awesome Title!' } }
}
}
tip

A better approach may be to set the label on the server side using rhino_properties_readable_name.

Set read-only​

const rhinoConfig = {
version: 1,
components: {
ModelFieldGroup: { props: { readOnly: true } }
}
}

Change placeholder​

const rhinoConfig = {
version: 1,
components: {
ModelFieldGroup: { props: { placeholder: 'Please enter title...' } }
}
}

ModelFieldGroupReference​

Additional filtering​

const rhinoConfig = {
version: 1,
components: {
ModelFieldGroupReference: { props: { filter: { published: true } } }
}
}

ModelFieldGroupOwnerReference​

Additional filtering​

By default, the owner reference field group will only show items owned by the current base owner.

const rhinoConfig = {
version: 1,
components: {
ModelFieldGroupReference: { props: { filter: { archived: false } } }
}
}

Component Hierarchy​