Elixir's UI (design)
Design (UI) components
Details

Details Component

This component is used to render a detailed view of items.

Preview

Imports

import EccUtilDesignDetails from '@elixir-cloud/design/dist/react/details/index';

Example

EccUtilsDesignDetails
import React from 'react';
import EccUtilDesignDetails from '@elixir-cloud/design/dist/react/details/index';
import { Action, Field } from '@elixir-cloud/design/dist/components/details/details';
 
const data: Object ={...}
const actions: Action[]=[...]
const fields: Field[]=[...]
 
export default function details() {
  return <EccUtilsDesignDetails data={data} fields={fields} actions={actions} />;
}

Properties

PropertyRequiredDefaultTypeDescription
datatrueObjectData to be rendered
fieldstrueArrayAn array of fields to render
actionsfalseArrayAn array of buttons and its configuration

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.
arrayOptions.typefalsedetail'detail' | 'tag'The type of array to be rendered. Prefer tag for smaller values.
arrayOptions.labelOptions.pathfalsestringThe path in the child object to be used as the label.
arrayOptions.labelOptions.prefixfalsestringThe prefix to be added to the label.
arrayOptions.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.

Button Options

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.

Link Options

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

Events

The component triggers a custom event, named ecc-utils-button-click, upon clicking a button with a specific key. This event conveys details about the clicked button, including its key and index. The app-author is expected to fire the event based on the key provided in the buttons prop to the element. This action is intended to activate the corresponding button associated with the specified key.

Event NameReact Event NameDescription
ecc-utils-button-clickEccUtilsButtonClickEventThis event conveys details about the clicked button, including its key and index. The app-author is expected to fire the event based on the key provided in the buttons prop to the element. This action is intended to activate the corresponding button associated with the specified key.

Event Payload

PropertyTypeDescription
keystringThe unique identifier of the clicked button.
indexnumberThe index of the button in reference to other buttons

Slots

🤠
Aye! Partner, hold on your horses! We're working here!

Parts

🔫
Bro! We are working!

CSS Variables

💣
Under construction.
;