Quasar Lists and List Items are a group of components which can work together to present multiple line items vertically as a single continuous element. They are best suited for displaying similar data types as rows of information, such as a contact list, a playlist, or menu. Each row is called an Item. Items can also be used outside of a List.
Lists can encapsulate Items or Item-like components, for example QCollapsible.
List Items have following content areas:
left side and right side (usually equipped for supplemental actions represented by icons, avatars, images or letters, but not limited to only these)
main content which usually is filled with a label (title) and sublabel (subtitle), form components, or anything else for that matter.
Notice that QItemMain and QItemSide can contain QItemTiles, or for convenience, you can use their own properties to define the content.
Due to how Webpack works in creating the bundle for your App, in some cases you may need to use QItemTile, like for avatars or images. The reason is simple: if you use QItemSide avatar property, you must supply the path to the statics folder and cannot use the assets folder or relative paths. Instead, the latter two can be used with a QItemTile wrapping an <img> HTML tag. Look closely at image paths in the example above (statics/guy-avatar.png vs ~assets/boy-avatar.png). Also read about App Handling Static Assets to understand how Webpack includes assets into the bundle.
Components
Below is a list of Quasar components that you can use to define lists and list items:
QList (encapsulating QItems and all other List related components)
QItemTile (for individual parts of QItemSide and QItemMain, like label, icon, avatar, image, …)
QList
QList encapsulates all other components mentioned. It’s not mandatory, but does help with maintaining a good design and can also define some properties that will be applied to all QItems (or QItem-like components) like multiline, separator, link, highlight and so on.
Vue Property
Type
Description
striped
Boolean
Apply highlight to QItems intermittently, starting with second QItem.
striped-odd
Boolean
Apply highlight to QItems intermittently, starting with first QItem.
highlight
Boolean
Apply highlight to all QItems. This works only on desktop when user hovers QItems.
link
Boolean
Apply highlight and a pointer cursor to all QItems.
dense
Boolean
Make QItems dense.
sparse
Boolean
Make QItems sparse.
multiline
Boolean
Make QItems multiline.
separator
Boolean
Make QItems have a separator between them.
inset-separator
Boolean
Make QItems have an inset separator between them.
dark
Boolean
When you component is rendered on a dark background
no-border
Boolean
Remove the default border around QList.
QListHeader
Within QList, you can display a section header / title.
If you want QItem external separators (there are internal ones too as you can see on QItem’s description later on this page), use the QItemSeparator component. It’s useful also to separate different sections of your QList, like for example, before a QListHeader.
Make QItem have a separator between it and previous QItem.
inset-separator
Boolean
Make QItem have an inset separator between it and previous QItem.
multiline
Boolean
Make QItem multiline. Vertically aligns QItem sides to top. Useful for more than 2-3 lines QItem content.
highlight
Boolean
Apply highlight to QItem. Works only on desktop when user hovers it.
link
Boolean
Apply highlight and a pointer cursor to QItem.
tag
String
Default HTML tag used is ‘div’, but this can be any HTML tag if you need to. Read below for more information.
dark
Boolean
When rendered on a dark background
Also check the next section for more properties and to learn about how you can use your QItem as a Router Link.
Using QItem as a Router Link
If you want your QItem to act the same as Vue’s <router-link>, then you can use these additional properties (which work exactly the same as <router-link>):
Property
Type
Description
to
String / Object
Route to navigate to
exact
Boolean
Match the exact route specified (and not also its children) when adding router-link-active CSS class.
append
Boolean
Append route definition to current route when navigating.
replace
Boolean
Replaces current route with the new one instead of adding it to the window history queue.
Please refer to the example on how to use the tag property shown below. In this example, we take advantage of the <label> tag that browsers automatically connect to checkboxes (QCheckbox, QToggle) or radio inputs (QRadio). When a <label> is clicked/tapped, then the wrapped checkboxes toggle their state (check / uncheck) and wrapped radios are being selected.
<!-- We want a click/tap on the whole QItem to toggle the checkbox, so we use tag="label" to make QItem render with <label> tag. --> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checkboxModel" /> </q-item-side> <q-item-main> <q-item-tilelabel>Notifications</q-item-tile> <q-item-tilesublabel>Notify me about updates to apps or games that I downloaded</q-item-tile> </q-item-main> </q-item>
Icon to use. Either use an icon, image, avatar or letter as props.
image
Boolean
Encapsulates an image. Its content must be an <img> with src attribute pointing to statics. Either use an icon, image, avatar or letter as props.
avatar
Boolean
Encapsulates an avatar image. Its content must be an <img> with src attribute pointing to statics. Either use an icon, image, avatar or letter as props.
letter
String
One character String to define a letter. Either use an icon, image, avatar or letter as props.
tag
String
Default HTML tag that QItemTile gets rendered with is ‘div’, but this can be any HTML tag if you need to.
There are more props available for QItemTile, but only use the following when QItemTile is wrapped with QItemMain:
Vue Property
Type
Description
label
Boolean
Encapsulates the label / title of QItem.
sublabel
Boolean
Encapsulates the sub-label / sub-title of QItem.
lines
String / Number
Number of lines the label/sublabel can span to. Ellipsis are used when overflowing. Use only in conjunction with label and sublabel.
Using QCollapsible with QItems
QCollapsible is a QItem wrapper, so you can use them as (and along) QItems within a QList. Here are two examples:
<!-- Notice we use QCollapsibles and QItems as direct children of QList. We are basically building a menu. --> <q-listseparator> <!-- collapsible to hide sub-level menu entries --> <q-collapsibleicon="inbox"label="Inbox"sublabel="Where your email is"> <q-itemlinkto="/inbox/1"> <q-item-sideicon="mail" /> <q-item-mainlabel="Email 1" /> </q-item> <q-itemlinkto="/inbox/2"> <q-item-sideicon="mail" /> <q-item-mainlabel="Email 2" /> </q-item> <q-collapsibleicon="favorite"label="Favorites"> <q-itemlinkto="/inbox/favorites/1"> <q-item-sideicon="mail" /> <q-item-mainlabel="Favorite 1" /> </q-item> <q-itemto="/inbox/favorites/2"> <q-item-sideicon="mail" /> <q-item-mainlabel="Favorite 2" /> </q-item> </q-collapsible> <q-itemto="/inbox/3"> <q-item-sideicon="mail" /> <q-item-mainlabel="Email 3" /> </q-item> </q-collapsible>
<!-- menu link --> <q-itemlinkto="/snoozed"> <q-item-sideicon="schedule" /> <q-item-main> <q-item-tilelabel>Snoozed</q-item-tile> </q-item-main> </q-item>
<!-- collapsible to hide sub-level menu entries --> <q-collapsibleicon="send"label="Sent"> <q-itemto="/sent/1"> <q-item-sideicon="mail" /> <q-item-mainlabel="Email 1" /> </q-item> </q-collapsible>
<!-- menu link --> <q-itemlinkto="/trash"> <q-item-sideicon="delete" /> <q-item-main> <q-item-tilelabel>Trash</q-item-tile> </q-item-main> </q-item> </q-list>
More Examples
Email list
<q-listhighlightinset-separator> <q-item> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-mainlabel="Brunch this weekend? Brunch this weekend? Brunch this weekend?"label-lines="1" /> <q-item-siderightstamp="1 min" /> </q-item> <q-itemmultiline> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-main label="Brunch this weekend? Brunch this weekend? Brunch this weekend?" label-lines="1" sublabel="John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe" sublabel-lines="2" /> <q-item-sideright> <q-item-tilestamp>1 week ago</q-item-tile> </q-item-side> </q-item> <q-itemmultiline> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-main label="Brunch this weekend? Brunch this weekend? Brunch this weekend?" label-lines="2" sublabel="John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe" /> <q-item-siderightstamp="10 min" /> </q-item> <q-itemmultiline> <q-item-side> <q-item-tileavatar> <imgsrc="statics/boy-avatar.png"> </q-item-tile> </q-item-side> <q-item-main> <q-item-tilelabel>Brunch <span>5</span></q-item-tile> <q-item-tilesublabellines="2"> John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe </q-item-tile> </q-item-main> <q-item-sideright> <q-item-tilestamp>10 min</q-item-tile> <q-item-tileicon="star"color="yellow" /> </q-item-side> </q-item> <q-itemmultiline> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-main> <q-item-tilelabellines="1">Brunch this weekend? Yeah, this weekend. Really. This one.</q-item-tile> <q-item-tilesublabellines="2"> <span>John Doe</span> -- I'll be in your neighborhood doing errands this weekend. Do you want to grab brunch? </q-item-tile> </q-item-main> <q-item-sideright> <q-item-tilestamp>2 years</q-item-tile> <q-item-tileicon="mail"color="primary" /> </q-item-side> </q-item> </q-list>
<q-listlink> <q-list-header>User controls</q-list-header> <q-item> <q-item-main> <q-item-tilelabel>Content filtering</q-item-tile> <q-item-tilesublabel>Set the content filtering level to restrict apps that can be downloaded</q-item-tile> </q-item-main> </q-item> <q-item> <q-item-main> <q-item-tilelabel>Password</q-item-tile> <q-item-tilesublabel>Require password for purchase or use password to restrict purchase</q-item-tile> </q-item-main> </q-item> <q-item-separator /> <q-list-header>General</q-list-header> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checked_one" /> </q-item-side> <q-item-main> <q-item-tilelabel>Notifications</q-item-tile> <q-item-tilesublabel>Notify me about updates to apps or games that I downloaded</q-item-tile> </q-item-main> </q-item> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checked_two"color="secondary" /> </q-item-side> <q-item-main> <q-item-tilelabel>Sound</q-item-tile> <q-item-tilesublabel>Auto-update apps at anytime. Data charges may apply</q-item-tile> </q-item-main> </q-item> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checked_three"color="red" /> </q-item-side> <q-item-main> <q-item-tilelabel>Auto-add widgets</q-item-tile> <q-item-tilesublabel>Automatically add home screen widgets</q-item-tile> </q-item-main> </q-item> </q-list>
<q-listclass="q-mt-md"> <q-list-header>Radios</q-list-header> <q-itemlinktag="label"> <q-item-side> <q-radiov-model="option"val="opt1" /> </q-item-side> <q-item-mainlabel="Option 1" /> </q-item> <q-itemlinktag="label"> <q-item-side> <q-radiocolor="secondary"v-model="option"val="opt2" /> </q-item-side> <q-item-main> <q-item-tilelabel>Option 2</q-item-tile> <q-item-tilesublabel>Allows notifications</q-item-tile> </q-item-main> </q-item> <q-itemlinktag="label"> <q-item-side> <q-radiocolor="amber"v-model="option"val="opt3" /> </q-item-side> <q-item-main> <q-item-tilelabel>Option 3</q-item-tile> <q-item-tilesublabellines="3">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</q-item-tile> </q-item-main> </q-item>
<q-item-separator />
<q-list-header>Toggles</q-list-header> <q-itemlinktag="label"> <q-item-mainlabel="Events and reminders" /> <q-item-sideright> <q-togglev-model="checked_one" /> </q-item-side> </q-item> <q-itemlinktag="label"multiline> <q-item-main> <q-item-tilelabel>Events and reminders</q-item-tile> <q-item-tilesublabel>Lorem ipsum</q-item-tile> </q-item-main> <q-item-sideright> <q-togglev-model="checked_two"color="secondary" /> </q-item-side> </q-item> <q-itemlinktag="label"multiline> <q-item-main> <q-item-tilelabel>Events and reminders</q-item-tile> <q-item-tilesublabellines="3"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute </q-item-tile> </q-item-main> <q-item-sideright> <q-togglev-model="checked_three"color="amber" /> </q-item-side> </q-item>
<q-list-header>Movies</q-list-header> <q-itemmultiline> <q-item-sideimage="statics/parallax1.jpg" /> <q-item-main> <q-item-tilelabel>Must-see places</q-item-tile> <q-item-tilesublabellines="3"> The world in which we live is full of wonderful places that most of us do not know they really exist. Here you can see some of those breathtaking places around the world. Enjoy! </q-item-tile> </q-item-main> <q-item-siderighticon="movie" /> </q-item> <q-itemmultiline> <q-item-sideimage="statics/parallax2.jpg" /> <q-item-main> <q-item-tilelabel>Building a Bridge</q-item-tile> <q-item-tilesublabellines="5"> A bridge is one of those things that are often taken for granted until you don’t have one, especially if you live on a rural property and there’s a creek between your house and the county road. John Doe had plans to build a new bridge along with building a new house on his property, but plans for the bridge were made top priority when a wayward truck carried too much weight over the old bridge and it collapsed. </q-item-tile> </q-item-main> <q-item-siderighticon="movie" /> </q-item> </q-list>