4.3.8 • Published 22 days ago

@dreamworld/dw-list-item v4.3.8

Weekly downloads
46
License
ISC
Repository
github
Last release
22 days ago

<dw-list-item> Published on npm

A material design item used to show single item of the list More detail

It also supports keyboard navigation. On Up/Down arrow key press it focuses next/previous sibling element. On Enter key press it selects the currently focused element.

Installation

npm install --save @dreamworld/dw-list-item

Usage

import "@dreamworld/dw-list-item/dw-list-item";

Basic (Single Line)

<dw-list-item title1="Item 1"></dw-list-item>

Two line

<dw-list-item title1="Main title" title2="Sub title" twoLine></dw-list-item>
<!-- Though, title2 isn't specified, will occupy 2 line height -->
<dw-list-item title1="Main title" twoLine></dw-list-item>

WIth leading and trailing icon

<dw-list-item title1="Item 1" leadingIcon="favorite" trailingIcon="done"></dw-list-item>

Disabled

<dw-list-item title1="Item 1" disabled></dw-list-item>

Dense

<dw-list-item title1="Item 1" dense></dw-list-item>

Property

NameTypeDefaultDescription
title1StringundefinedItem's text to be shown in first line
title2StringundefinedItem's text to be shown in the second line.
denseBooleanfalseSet to true to show dense item. Dense item will have less height compare to normal item
leadingIconStringundefinedName of icon to show as a leading icon
trailingIconStringundefinedName of icon to show as a trailing icon
twoLineBooleanfalseSet to true to show twoLine item
disabledBooleanfalseShows disabled style when true
selectedBooleanfalseSet to true to show item preselected. It will be set to true on click or enter.
selectionModeSelectionModedefaultWhether selection should be toggled or default/forced. if item isn't yet selected, it becomes selected. If item is already selected, no change in the selection state. While in toggle mode, selection is toggled. while in none mode, selection won't work so it's view-only item in this mode. Possible values: default, toggle, and none
hasLeadingIconBooleanfalseSet to true when item has leading icon.
hasTrailingIconBooleanfalseset to true when item has trailing icon.
leadingIconFontIconFontFILLEDType of the leading icon. Possible values: FILLED, and OUTLINED
trailingIconFontIconFontFILLEDType of the trailing icon. Possible values: FILLED, and OUTLINED
tooltipPlacementStringundefinedUse to set placement of tooltip.
showSelectedRippleBooleanfalseSet it to true to show ripples on the selected item.
focusableBooleantrueWhether or not list-item is focusable.
activatedBooleanfalseWhether or not list-item is activated. Same style as focused.
highlightStringundefinedContains highlight words

Events

NameTargetDetailDescription
selection-changeddw-list-itemnoneTriggers when selection is changed.

CSS Custom Properties

NameDefaultDescription
--mdc-theme-primary#6200eeSelected item's background color and icon color.
--mdc-theme-text-primaryrgba(0, 0, 0, 0.87)Primary title's text color.
--mdc-theme-text-secondaryrgba(0, 0, 0, 0.6)Sub title's text color.
--mdc-theme-text-disabledrgba(0, 0, 0, 0.38)Disabled text color when item is disabled.
--dw-icon-colorrgba(0, 0, 0, 0.38)Icon color in normal mode. In selection mode --mdc-theme-primary color will be used
--dw-icon-color-active#6200eeLeading and Trailing icon color.
--dw-select-highlight-text-colorinheritHighlight span text color
--dw-select-highlight-bg-colorinheritHighlight span backgroound color
--dw-select-highlight-font-weightinheritHighlight span text font weight
4.3.8

22 days ago

4.3.7

1 month ago

4.3.6

2 months ago

4.3.5

2 months ago

4.3.4

2 months ago

4.3.3

2 months ago

4.3.2

4 months ago

4.3.1-ssr.1

1 year ago

4.3.1

1 year ago

4.2.0

1 year ago

4.3.0

1 year ago

3.9.0

2 years ago

3.8.0

2 years ago

3.6.0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.2

2 years ago

3.7.0

2 years ago

3.5.0

2 years ago

4.1.0

2 years ago

4.1.1

1 year ago

3.4.0

2 years ago

3.3.0

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

3 years ago

2.1.0

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago