Data entity
Data entity
Component demo
Interactive example
<ic-data-entityheading="Order details"><ic-data-rowlabel="Order name"value="Michael"><ic-linkhref="#"slot="end-component"> Edit</ic-link></ic-data-row><ic-data-rowlabel="Drink"value="Americano"><ic-linkhref="#"slot="end-component"> Edit</ic-link></ic-data-row><ic-data-rowlabel="Milk option"value="Soya milk"><ic-linkhref="#"slot="end-component"> Edit</ic-link></ic-data-row><ic-data-rowlabel="Price"value="£3.25"><ic-linkhref="#"slot="end-component"> Edit</ic-link></ic-data-row><ic-data-rowlabel="Payment method"><ic-typographyvariant="body"slot="value"> VISA ending 5896</ic-typography><ic-linkhref="#"slot="end-component"> Edit</ic-link></ic-data-row><ic-data-rowlabel="Download receipt"value="CoffeeOrder_X46w32.pdf"><ic-buttonvariant="icon"aria-label="Download"slot="end-component"><svgviewBox="0 0 24 24"height="24"width="24"><pathd="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"fill="currentColor"/></svg></ic-button></ic-data-row></ic-data-entity>
<IcDataEntityheading="Order details"><IcDataRowlabel="Order name"value="Michael"><IcLinkhref="#"slot="end-component"> Edit</IcLink></IcDataRow><IcDataRowlabel="Drink"value="Americano"><IcLinkhref="#"slot="end-component"> Edit</IcLink></IcDataRow><IcDataRowlabel="Milk option"value="Soya milk"><IcLinkhref="#"slot="end-component"> Edit</IcLink></IcDataRow><IcDataRowlabel="Price"value="£3.25"><IcLinkhref="#"slot="end-component"> Edit</IcLink></IcDataRow><IcDataRowlabel="Payment method"><IcTypographyvariant="body"slot="value"> VISA ending 5896</IcTypography><IcLinkhref="#"slot="end-component"> Edit</IcLink></IcDataRow><IcDataRowlabel="Download receipt"value="CoffeeOrder_X46w32.pdf"><IcButtonvariant="icon"aria-label="Download"slot="end-component"><SlottedSVGviewBox="0 0 24 24"height="24"width="24"><pathd="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"fill="currentColor"/></SlottedSVG></IcButton></IcDataRow></IcDataEntity>
Data row details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The label in the leftmost cell of the row. |
|
|
The size of the data row component. |
|
|
|
|
|
The value of the middle (right if no end-component supplied) cell of the row. |
|
The label in the leftmost cell of the row. |
The size of the data row component. |
|
The value of the middle (right if no end-component supplied) cell of the row. |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
---|---|
|
|
|
|
|
|
|
|
|
Data entity details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The title for the data entity. |
|
|
The size of the data entity component. |
|
|
|
|
The title for the data entity. |
The size of the data entity component. |
|
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
---|---|
|
|
|
Variants
With status tags
Interactive example
<ic-data-entityheading="Order details"><ic-data-rowlabel="Order name"value="Michael"></ic-data-row><ic-data-rowlabel="Drink"value="Americano"><ic-status-tagstatus="warning"label="In Progress"variant="filled"slot="end-component"/></ic-data-row><ic-data-rowlabel="Milk option"value="Soya milk"></ic-data-row><ic-data-rowlabel="Price"value="£3.25"></ic-data-row><ic-data-rowlabel="Payment method"><ic-typographyvariant="body"slot="value"> VISA ending 5896</ic-typography><ic-status-taglabel="Not Confirmed"variant="filled"slot="end-component"/></ic-data-row></ic-data-entity>
<IcDataEntityheading="Order details"><IcDataRowlabel="Order name"value="Michael"/><IcDataRowlabel="Drink"value="Americano"><IcStatusTagstatus="warning"label="In Progress"variant="filled"slot="end-component"/></IcDataRow><IcDataRowlabel="Milk option"value="Soya milk"/><IcDataRowlabel="Price"value="£3.25"/><IcDataRowlabel="Payment method"><IcTypographyvariant="body"slot="value"> VISA ending 5896</IcTypography><IcStatusTaglabel="Not Confirmed"variant="filled"slot="end-component"/></IcDataRow></IcDataEntity>
Size small
Interactive example
London
SW7 988
United Kingdom
<ic-data-entityheading="Personal details"size="small"><ic-data-rowlabel="Name"value="Michael Johnson"><ic-status-tagstatus="success"label="confirmed"variant="filled"slot="end-component"size="small"></ic-status-tag></ic-data-row><ic-data-rowlabel="Date of birth"value="16 October 1995"><ic-status-tagstatus="warning"label="in review"variant="filled"slot="end-component"size="small"></ic-status-tag></ic-data-row><ic-data-rowlabel="Telephone"value="07449 7654873"><ic-status-tagstatus="warning"label="in review"variant="filled"slot="end-component"size="small"></ic-status-tag></ic-data-row><ic-data-rowlabel="Email"value="mjohnson@coffee.gov"><ic-status-tagstatus="success"label="confirmed"variant="filled"slot="end-component"size="small"></ic-status-tag></ic-data-row><ic-data-rowlabel="Address"><ic-typographyvariant="body"slot="value"> 383 Coffee Drive<br/> London<br/> SW7 988<br/> United Kingdom</ic-typography><ic-status-taglabel="not confirmed"variant="filled"slot="end-component"size="small"></ic-status-tag></ic-data-row></ic-data-entity>
<IcDataEntityheading="Personal details"size="small"><IcDataRowlabel="Name"value="Michael Johnson"><IcStatusTagstatus="success"label="confirmed"variant="filled"slot="end-component"size="small"/></IcDataRow><IcDataRowlabel="Date of birth"value="16 October 1995"><IcStatusTagstatus="warning"label="in review"variant="filled"slot="end-component"size="small"/></IcDataRow><IcDataRowlabel="Telephone"value="07449 7654873"><IcStatusTagstatus="warning"label="in review"variant="filled"slot="end-component"size="small"/></IcDataRow><IcDataRowlabel="Email"value="mjohnson@coffee.gov"><IcStatusTagstatus="success"label="confirmed"variant="filled"slot="end-component"size="small"/></IcDataRow><IcDataRowlabel="Address"><IcTypographyvariant="body"slot="value"> 383 Coffee Drive<br/> London<br/> SW7 988<br/> United Kingdom</IcTypography><IcStatusTaglabel="not confirmed"variant="filled"slot="end-component"size="small"/></IcDataRow></IcDataEntity>
Editable example
Interactive example
<ic-data-entityheading="Order details"><ic-data-rowlabel="Order name"><ic-text-fieldslot="value"label="Order name"value="Michael"readonly="true"hide-label="true"full-width="true"/></ic-data-row><ic-data-rowlabel="Drink"><ic-text-fieldslot="value"label="Drink"value="Americano"readonly="true"hide-label="true"full-width="true"/></ic-data-row><ic-data-rowlabel="Milk option"><ic-text-fieldslot="value"label="Milk option"value="Soya milk"readonly="true"hide-label="true"full-width="true"/></ic-data-row><ic-data-rowlabel="Price"><ic-text-fieldslot="value"label="Price"value="£3.25"readonly="true"hide-label="true"full-width="true"/></ic-data-row><ic-data-rowlabel="Payment method"><ic-text-fieldslot="value"label="Payment method"value="VISA ending 5896"readonly="true"hide-label="true"full-width="true"/></ic-data-row></ic-data-entity><divclass="btn-container"><ic-buttonid="confirm-button"> Confirm</ic-button><ic-buttonid="edit-button"variant="secondary"> Edit</ic-button></div>
<IcDataEntityheading="Order details"><IcDataRowlabel="Order name"><IcTextFieldslot="value"label="Order name"value="Michael"readonlyhideLabelfullWidth/></IcDataRow><IcDataRowlabel="Drink"value="Americano"><IcTextFieldslot="value"label="Drink"value="Americano"readonlyhideLabelfullWidth/></IcDataRow><IcDataRowlabel="Milk option"value="Soya milk"><IcTextFieldslot="value"label="Milk option"value="Soya milk"readonlyhideLabelfullWidth/></IcDataRow><IcDataRowlabel="Price"value="£3.25"><IcTextFieldslot="value"label="Price"value="£3.25"readonlyhideLabelfullWidth/></IcDataRow><IcDataRowlabel="Payment method"><IcTextFieldslot="value"label="Payment method"value="VISA ending 5896"readonlyhideLabelfullWidth/></IcDataRow></IcDataEntity><divclassName={classes.btnContainer}><IcButtononClick={()=>{const textFields =document.querySelectorAll('ic-text-field'); textFields.forEach((textField)=>{ textField.setAttribute('readonly','');});}}> Confirm</IcButton><IcButtononClick={()=>{const textFields =document.querySelectorAll('ic-text-field'); textFields.forEach((textField)=>{ textField.removeAttribute('readonly');});}}variant="secondary"> Edit</IcButton></div>