Documentation
Design Package
Components
Details

Details Component

Beta
0.1.1
<ecc-utils-design-details/>
EccUtilsDesignDetails

Overview

This component is used to render a detailed view of items. It provides a user-friendly interface for displaying data in a structured manner, with built-in support for rendering fields and actions.

Preview

Examples

Basic Usage

EccUtilsDesignDetailsExample.tsx
import React from 'react';
import EccUtilsDesignDetails from '@elixir-cloud/design/dist/react/details';
 
export default function CodeEditor() {
  return <EccUtilsDesignDetails
    items={[...]}
  />;
}

Properties

PropertyRequiredDefaultTypeDescription
datatrueObjectThe data to be rendered.
fieldstruefieldsAn array of fields and its configuration
actionsfalse[]ArrayAn array of buttons and its configuration

data*

The data property allows you to define the data to be rendered in the component. The data object can be a simple object or a complex object with nested properties.

fields*

The fields property allows you to define an array of fields along with their configuration. Fields can be used to render specific data from the data object.

PropertyRequiredDefaultTypeDescription
keytruestringA unique identifier for the field, used to distinguish between fields in the configuration.
pathtruestringThe path to the data to be rendered.
tabfalsestringThe tab group to which the field belongs.
parentKeyfalsestringThe parent key of the field. Recommended if tab is not provided.
labelfalsestringThe display name or label for the field.
tooltipfalsestringThe tooltip to be displayed on hover.
copyfalsefalsebooleanA flag to indicate if the field should be copied.
arrayOptionsfalsearrayOptionsThe configuration for rendering arrays.

arrayOptions

The arrayOptions property allows you to define the configuration for rendering arrays.

PropertyRequiredDefaultTypeDescription
typefalsedetail'detail' | 'tag'The type of array to be rendered. Prefer tag for smaller values.
labelOptions.pathfalsestringThe path in the child object to be used as the label.
labelOptions.prefixfalsestringThe prefix to be added to the label.
labelOptions.suffixfalsestringThe suffix to be added to the label.

actions

The actions property allows you to define an array of actions along with their configuration. Actions can be used to render buttons or links.

PropertyRequiredDefaultTypeDescription
keytruestringA unique identifier for the action, used to distinguish between actions in the configuration.
labeltruestringThe display name or label for the action.
typefalsebuttonbutton | linkThe type of action to be rendered.
positionfalserightleft | rightThe position of the action.
buttonOptionsfalseObjectThe configuration for the button. Can be used if type is button.
linkOptionsfalseObjectThe configuration for the link. Can be used if type is link.

buttonOptions

PropertyRequiredDefaultTypeDescription
variantfalseprimaryprimary | success | neutral | warning | danger | textThe variant of the button.
loadingfalsefalsebooleanA flag to indicate if the button should be in a loading state.
disabledfalsefalsebooleanA flag to indicate if the button should be disabled.
sizefalsemediumsmall | medium | largeThe size of the button.
icon.urlfalsestringThe URL of the icon to be displayed.
icon.positionfalseprefixprefix | suffixThe position of the icon.

linkOptions

PropertyRequiredDefaultTypeDescription
urltruestringThe URL to be navigated to.
sizefalsemediumsmall | medium | largeThe size of the link.

Events

Event NameReact Event NameDescription
ecc-utils-button-clickEccUtilsButtonClickEventFired when a button is clicked. The event payload contains the key of the clicked button.

Event Payload

PropertyTypeDescription
keystringThe unique identifier of the clicked button.
Elixir Cloud & AAICloud SDKElixir

Released under Apache 2.0 License.

Copyright © 2023-2024 ELIXIR