react-toolbox/components/list
Javi Velasco 81acda7162 Migrate styles to PostCSS (#666)
* Add postcss-next postcss-include and reporter

* Add stylelint

* Add CSS colors

* Add CSS custom media queries

* Use dashes for CSS colors

* Add base CSS variables

* Remove AppBar SASS dependency from spec page

* Migrate AppBar style to PostCSS

* Migrate Avatar style to PostCSS

* Migrate Ripple style to PostCSS

* Remove unneeded media CSS import in Avatar

* Add shadows to CSS variables

* Migrate Button style to PostCSS

* Update webpack test config and linting from npm

* Migrate Input style to PostCSS

* Add missing input config variables for Dropdown and Autocomplete

* Migrate Chip style to PostCSS

* Migrate Autocomplete style to PostCSS

* Migrate Dropdown style to PostCSS

* Migrate animations to PostCSS

* Migrate Card style to PostCSS

* Migrate Checkbox style to PostCSS

* Migrate DataPicker style to PostCSS

* Migrate Dialog style to PostCSS

* Migrate Drawer style to PostCSS

* Add postcss-mixins and postcss-each

* Migrate Layout style to PostCSS

* Fix bug in button theme

* Bugfix in avatar css

* Add some missing nesting notations

* Migrate Link style to PostCSS

* Migrate List style to PostCSS

* Migrate Menu style to PostCSS

* Migrate Navigation style to PostCSS

* Migrate Overlay style to PostCSS

* Migrate ProgressBar style to PostCSS

* Migrate Radio style to PostCSS

* Migrate Slider style to PostCSS

* Migrate Snackbar style to PostCSS

* Migrate Switch style to PostCSS

* Migrate Table style to PostCSS

* Migrate Tabs style to PostCSS

* Migrate TimePicker to PostCSS

* Migrate Tooltip styles to PostCSS

* Update webpack config for testing and tests

* Migrate commons to PostCSS

* Remove sass from main project

* Bye from docs to sass

* Build with CSS

* Remove unneded deps for sass in docs subproject

* Fix tests

* use 4p shadow in AppBar as spec indicates

* Fixed typo in list/config.css

* Fix tests

* Fix linter errors

* Latest build

* Release 2.0.0-beta.0

* Remove sass lint

* fixes old sass var in css config

* Update linter

* New Table implementation

* Fix old sass var in list/config.css

See da0c47041e.

* Remove normalize.css from commons.css

* Update dependencies

* Latest build

* Input ready to accept visible hint

* Prepare slider and progress to be disabled

* Render Snackbar using Portal

* Refactor Dialog, Drawer and Overlay to be used in Layout

* Add inner layer to AppBar

* New layout

* Use Layout in spec

* Latest build

* remove layout playground example

* add smTablet and lgTablet to NavDrawer in Layout readme

* add default prop className to Layout, NavDrawer and Sidebar

* fix css linter errors in card and slider

* Typings for Table component

* Add missing Drawer identifier

* Update lib build

* Adds onQueryChange callback property to Autocomplete

The onQueryChange callback is called when the value of the query changes in Autocomplete.
It is called with the new query value.

* Fix #966

* Fix #965

* Fixes #976

* Updated css-related dependencies

Removed usages of `addDependencyTo` since it's deprecated and not needed anymore.
See https://github.com/postcss/postcss-import#adddependencyto

* Enabled HMR for styles by disabling extracting them to a CSS file

* Remove lib from repo

* Remove lib

* Fixes #1021

* Build using Gulp

* Export ThemeProvider from react-css-themr

* Add CHANGELOG to release command

* Release 2.0.0-beta.1

* Remove immutability helper

* Update dependencies

* Fix Tooltip trying to render after it's been unmounted

* Fixes #1038

* Release 2.0.0-beta.2

* Add ramda, refactor utils and remove slide animation modules

* Remove separate slide animations modules

* Remove box-sizing reset and body rule

* Remove commons.css

* Release 2.0.0-beta.4

* Update dependencies

* Fixes #1061

* More aggresive guard condition for multiple autocomplete

* Fix typeof check in isBrowser function

* Fixes an issue when specs are opened with browsers that do not support Object.entries().

* Import from ramda using the 'import XXX from "ramda/src/XXX"' pattern so that bundle sizes will be smaller for not including the whole ramda package.

* Fix #1032

* Fix tests

* Update yarn.lock

* Fixes #1064
2017-01-05 02:42:18 +01:00
..
List.js Fix #910 2016-11-18 19:15:13 +01:00
ListCheckbox.js Better PropType syntax and delete required className api 2016-06-03 23:44:33 +02:00
ListDivider.js Better PropType syntax and delete required className api 2016-06-03 23:44:33 +02:00
ListItem.js Add onTouchStart to ListItem 2016-08-23 23:06:45 +08:00
ListItemAction.js Better PropType syntax and delete required className api 2016-06-03 23:44:33 +02:00
ListItemActions.js Pass theme down to list item child components for correct classnames 2016-07-25 08:28:31 -07:00
ListItemContent.js fix few missing propTypes 2016-12-19 20:39:07 +01:00
ListItemLayout.js Pass theme down to list item child components for correct classnames 2016-07-25 08:28:31 -07:00
ListItemText.js Better PropType syntax and delete required className api 2016-06-03 23:44:33 +02:00
ListSubHeader.js Better react imports for lists 2016-05-29 21:11:04 +02:00
config.css Migrate styles to PostCSS (#666) 2017-01-05 02:42:18 +01:00
index.d.ts update typings to 1.3.3 2016-12-19 20:13:36 +01:00
index.js Migrate styles to PostCSS (#666) 2017-01-05 02:42:18 +01:00
readme.md Update Google URLs 2016-11-06 21:18:36 +02:00
theme.css Migrate styles to PostCSS (#666) 2017-01-05 02:42:18 +01:00

readme.md

List

A list component consists of a single continuous column of tessellated sub-divisions of equal width called rows that function as containers for tiles. Tiles hold content, and can vary in height within a list.

Lists are best suited to presenting a homogeneous data type or sets of data types, such as images and text, optimized for reading comprehension with the goal of differentiating between like data types or qualities within a single data type. You can compose lists based on subcomponents.

import { List, ListItem, ListSubHeader, ListDivider, ListCheckbox } from 'react-toolbox/lib/list';

const ListTest = () => (
  <List selectable ripple>
    <ListSubHeader caption='Explore characters' />
    <ListItem
      avatar='https://dl.dropboxusercontent.com/u/2247264/assets/m.jpg'
      caption='Dr. Manhattan'
      legend="Jonathan 'Jon' Osterman"
      rightIcon='star'
    />
    <ListItem
      avatar='https://dl.dropboxusercontent.com/u/2247264/assets/o.jpg'
      caption='Ozymandias'
      legend='Adrian Veidt'
      rightIcon='star'
    />
    <ListItem
      avatar='https://dl.dropboxusercontent.com/u/2247264/assets/r.jpg'
      caption='Rorschach'
      legend='Walter Joseph Kovacs'
      rightIcon='star'
    />
    <ListSubHeader caption='Configuration' />
    <ListCheckbox checked caption='Notify new comics' legend='You will receive a notification when a new one is published' />
    <ListDivider />
    <ListItem caption='Contact the publisher' leftIcon='send' />
    <ListItem caption='Remove this publication' leftIcon='delete' />
  </List>
);

If you want to provide styles via context to this components, you should use the key RTList.

List

Is used as a wrapper for the list. It can hold properties that affect to the whole list and get styles for the wrapper.

Properties

Name Type Default Description
className String '' Sets a class to give custom styles to the list wrapper.
ripple Boolean false If true, each element in the list will have a ripple effect on click
selectable Boolean false If true, the elements in the list will display a hover effect and a pointer cursor.

Theme

Name Description
list Used for the root element of the list.

List Item

Represents a list item that can have avatar, icons, title, subtitle, etc. Note: you have to set it as an inmediate child of List component.

Properties

Name Type Default Description
avatar String or Element A string URL to specify an avatar in the left side of the item.
caption String Main text of the item.
className String '' Set a class to give custom styles to the list item.
disabled String false If true, the item is displayed as disabled and is not clickable.
itemContent Element An element that will be displayed as the item. If set, this will override caption and legend.
leftActions Array of Elements A list of elements that are placed on the left side of the item and after the avatar attribute.
leftIcon String or Element A string key of a font icon or element to display an icon in the left side of the item.
legend String Secondary text to display under the caption.
onClick Function Callback the is invoked when the item is clicked if it's not disabled.
rightIcon String or Element The same as the leftIcon but in this case the icon is displayed in the right side.
rightActions Array of Elements A list of elements that are placed on the right side of the item and after the rightIcon attribute.
ripple Boolean false If true, the item displays a ripple effect on click. By default it's inherited from the parent element.
selectable Boolean false If true, the elements in the list will display a hover effect and a pointer cursor. Inherited from the parent.
to String In case you want to provide the item as a link, you can pass this property to specify the href.

Theme

Name Description
disabled Added to the inner content if its a disabled item.
item Used for the inner content of a list item.
itemAction Used for each action element (left/right).
itemContentRoot Used for the content wrapper element in list item.
itemText Added to the text inside of the list item.
large Added to the content wrapper element if size is large.
left Added for the element that wraps left actions.
listItem Used for the root element of the list.
primary Added to the text inside of the list item if its primary.
right Added for the element that wraps right actions.
selectable Added to the inner content if its a selectable item.

List Checkbox

A special type of item that has a checkbox control on the left side. It implements similar methods to the ListItem component and some additional to control the checkbox.

Properties

Name Type Default Description
caption String Main text of the item. Required.
className String Set a class to give custom styles to Component.
checked Boolean false If true the checkbox appears checked by default.
disabled String false If true, the item is displayed as disabled and it's not clickable.
legend String Secondary text to display under the caption.
name String Name for the checkbox input item.
onBlur Function Callback called when the input element is blurred.
onChange Function Callback called when the input element is changed.
onFocus Function Callback called when the input element is focused.

Theme

Name Description
checkbox Used as a wrapper class for the subheader element.
checkboxItem Added to the checkbox element.
disabled Added to the root element if the component is disabled.
item Used as a wrapper class root element element. Same as List.
itemContentRoot Used for the content wrapper element in list item.
itemText Added to the text inside of the list item.
large Added to the content wrapper element if size is large.
primary Added to the text inside of the list item if its primary.

List Subheader

Simple subcomponent used to give a title to a list area.

Properties

Name Type Default Description
caption String Text that will be displayed.
className String '' Set a class to give custom styles to the list subheader.

Theme

Name Description
subheader Used as a wrapper class for the subheader element.

List Divider

Simple subcomponent used to separate list sections or items. It has only one property inset which is a Boolean that indicates if the divider should be full with or should leave an space to the left side. It has two theming keys: inset and divider that will be used depending on wether it should full width or leave space.