A Description List component.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

groupsArray

Array of groups of terms and descriptions.

idstring

The ID of the component.

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

titlestring

The title for the component.

titleAttributesobject

Custom attributes for the title.

titleClassesstring | Array | object

Custom classes for the title.

typestring

The type of description list, one of default or list.

refobject | null

Ref to the component.

Since
  • 3.4.0
Returns:

The description list component.

Type: 
JSX.Element
Example
import DescriptionList from '@gravityforms/components/react/admin/elements/DescriptionList';

const groups = [
  {
    terms: {
      component: 'Text',
      props: {
        content: 'Chrome',
        size: 'text-sm',
        weight: 'semibold',
      },
    },
    descriptions: {
      component: 'Text',
      props: {
        content: 'A cross-platform web browser developed by Google.',
        size: 'text-sm',
      },
    },
    wrapper: true,
  },
  {
    terms: {
      component: 'Text',
      props: {
        content: 'Firefox',
        size: 'text-sm',
        weight: 'semibold',
      },
    },
    descriptions: [
      {
        component: 'Text',
        props: {
          content: 'A free, open source, cross-platform, graphical web browser developed by the Mozilla Corporation and hundreds of volunteers.',
          size: 'text-sm',
        },
      },
      {
        component: 'Text',
        props: {
          content: 'The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long).',
          size: 'text-sm',
        },
      },
    ],
  },
  {
    terms: [
      {
        component: 'Text',
        props: {
          content: 'Internet Explorer',
          size: 'text-sm',
          weight: 'semibold',
        },
      },
      {
        component: 'Text',
        props: {
          content: 'Netscape',
          size: 'text-sm',
          weight: 'semibold',
        },
      },
    ],
    descriptions: {
      component: 'Text',
      props: {
        content: 'Browsers that have been discontinued.',
        size: 'text-sm',
      },
    },
  },
];

return <DescriptionList groups={ groups } />;