List Group
List groups are flexible components used for displaying a list of related content.
Example
List groups support any content inside of them. Take advantage of their flexibility to display list of items properly, as well as vertical navigation.
<i-list-group>
<i-list-group-item active>Active</i-list-group-item>
<i-list-group-item href="https://inkline.io">Link</i-list-group-item>
<i-list-group-item :to="{ name: 'index' }">Router Link</i-list-group-item>
<i-list-group-item>Item</i-list-group-item>
<i-list-group-item disabled>Disabled</i-list-group-item>
</i-list-group>
Behind the scenes, the <i-list-group-item>
is converted into a <router-link>
if it has the :to
property, or a plain <a>
tag if it has a href
property. Otherwise, it uses a simple <div>
tag.
Sizes
You're able to use the size
modifier to control the padding of your list groups, using one of the available sizes: sm
, md
, and lg
. The default size is set to md
.
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
List Group Item
<i-list-group size="sm">
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
</i-list-group>
<i-list-group size="md">
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
</i-list-group>
<i-list-group size="lg">
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
</i-list-group>
Active State
You can control the active state of your <i-list-group-item>
using the active
property. If you're providing a :to
property, converting it into a router-link
, you can use the active-class
and exact-active-class
properties and set them to -active
.
<i-list-group>
<i-list-group-item :to="{ name: 'docs-components-list-group' }" exact-active-class="-active">Active Router Link</i-list-group-item>
<i-list-group-item :to="{ name: 'index' }" active>Active Link</i-list-group-item>
</i-list-group>
Disabled State
You can control the disabled state of your <i-list-group-item>
using the disabled
property.
Disabled List Group Item
List Group Item
<i-list-group>
<i-list-group-item disabled>Disabled List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
</i-list-group>
List Group Border
You can disable the border of your list group by setting the bordered
property to false.
List Group Item
List Group Item
List Group Item
List Group Item
<i-list-group :bordered="false">
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
<i-list-group-item>List Group Item</i-list-group-item>
</i-list-group>
Item Content
The <i-list-group-item>
accepts any type of content, allowing you to create large sized list group items.
List Group Heading
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
List Group Heading
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
List Group Heading
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<i-list-group>
<i-list-group-item>
<h4>List Group Heading</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</i-list-group-item>
<i-list-group-item>
<h4>List Group Heading</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</i-list-group-item>
<i-list-group-item>
<h4>List Group Heading</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</i-list-group-item>
</i-list-group>
Component API
Here you can find a list of the various customization options you can use for the list group components as props, as well as available slots.
Property bordered
Type Boolean
Accepted true
, false
Default true
Description Sets the list group component style to be bordered.
Property size
Type String
Accepted sm
, md
, lg
Default md
Description Sets the size of the list group component.
Description Slot for list group default content.
Property active
Type Boolean
Accepted true
, false
Default false
Description Sets the list group item state as active.
Property disabled
Type Boolean
Accepted true
, false
Default false
Description Sets the list group item state as disabled.
Property tag
Type String
Default div
Description Sets the tag to be used for the component. If to
or href
attribute is provided, an a
tag will be used.
Description Slot for list group item default content.
Sass Variables
Here you can find a list of the Sass variables you can use for the list group components. If you're looking to find common variables that these rely on, you should take a look at the Sass Variables page.
Property $list-group-font-size
Default $font-size
Property $list-group-item-disabled-color
Default $text-muted
Property $list-group-item-padding-base
Default $spacer
Property $list-group-item-padding
Default size-map($list-group-item-padding-base, $sizes, $size-multipliers)
Property $list-group-border-width
Default $border-width
Property $list-group-border-style
Default solid
Property $list-group-background-color-light
Default $body-background-light
Property $list-group-border-color-light
Default $border-color-light
Property $list-group-background-color-dark
Default $body-background-dark
Property $list-group-border-color-dark
Default $border-color-dark
Property $list-group-border-radius
Default $border-radius
Property $list-group-item-active-background
Default $color-primary
Property $list-group-item-active-color
Default $color-white
Property $list-group-item-active-border-color
Default darken-lightness($color-primary, 6%)
Property $list-group-color-for-light-variant
Default $color-for-light-variant
Property $list-group-color-for-dark-variant
Default $color-for-dark-variant
Property $list-group-variant-{variant}
Default list-group-variant($color-{variant})
Property $list-group-variants
Default (
light: $list-group-variant-light,
dark: $list-group-variant-dark
)
Function list-group-variant
Default @function list-group-variant($variant) {
$list-group-variant-color: variant-color-by-luminance($variant, $list-group-color-for-light-variant, $list-group-color-for-dark-variant);
$list-group-variant-background: $variant;
$list-group-variant-border-color: variant-color-by-luminance($variant, $border-color-dark, $border-color-light);
$variant-map: (
color: $list-group-variant-color,
background: $list-group-variant-background,
border-color: $list-group-variant-border-color,
);
@return $variant-map;
}