Svelte List Group - Bitblue

Display a series of content items as a list, with links, buttons, and horizontal layouts

Build vertical or horizontal lists from data (items) or compose ListgroupItem children. Set active to render interactive button items.

Setup

<script lang="ts">
	import { Listgroup, ListgroupItem } from '.';
</script>

Default list

  • Profile
  • Settings
  • Messages
  • Download
<script lang="ts">
	import { Listgroup } from '.';
</script>

<Listgroup items={['Profile', 'Settings', 'Messages', 'Download']} />

Object items

Pass objects with name, href, current, disabled, and onclick.

<script lang="ts">
	import { Listgroup } from '.';
</script>

<Listgroup
	items={[
		{ name: 'Profile', href: '#', current: true },
		{ name: 'Settings', href: '#' },
		{ name: 'Billing', href: '#', disabled: true }
	]}
/>

Links and current item

<script lang="ts">
	import { Listgroup, ListgroupItem } from '.';
</script>

<Listgroup>
	<ListgroupItem href="/docs" current>Docs</ListgroupItem>
	<ListgroupItem href="/">Home</ListgroupItem>
	<ListgroupItem href="#" disabled>Disabled</ListgroupItem>
</Listgroup>

Active buttons

active on the group renders items as buttons with hover styles.

<script lang="ts">
	import { Listgroup, ListgroupItem } from '.';
</script>

<Listgroup active>
	<ListgroupItem onclick={() => {}}>Profile</ListgroupItem>
	<ListgroupItem onclick={() => {}} current>Messages</ListgroupItem>
</Listgroup>

Horizontal

  • Profile
  • Settings
  • Messages
<script lang="ts">
	import { Listgroup } from '.';
</script>

<Listgroup horizontal items={['Profile', 'Settings', 'Messages']} />

Without border / rounded

  • One
  • Two
  • Three
  • One
  • Two
  • Three
<Listgroup border={false} items={['One', 'Two', 'Three']} />
<Listgroup rounded={false} items={['One', 'Two', 'Three']} />

Item with icon

<script lang="ts">
	import { Listgroup, ListgroupItem } from '.';
	import type { Component } from 'svelte';

	const UserIcon: Component = () => null; // replace with your icon component
</script>

<Listgroup>
	<ListgroupItem Icon={UserIcon} name="Profile" />
</Listgroup>

Props

Listgroup (ListgroupProps)

PropTypeDefaultDescription
items(string \| ListgroupItemType)[]—Data-driven items
childrenSnippet<[item]>—Custom item renderer / ListgroupItem children
activeboolean—Render as button list (div root)
horizontalbooleanfalseRow layout with vertical dividers
roundedbooleantrueRounded corners
borderbooleantrueOuter border
onclick(event: MouseEvent) => void—Shared click handler
class / classestheme slots—base / item / icon overrides
...restHTML attributes—Root element attrs

ListgroupItemType

FieldTypeDescription
namestringLabel
hrefstringLink target
currentbooleanCurrent/active style
disabledbooleanDisabled state
onclick(event: MouseEvent) => voidItem click

ListgroupItem (ListgroupItemProps)

PropTypeDefaultDescription
childrenSnippet—Item content
namestring—Text when no children
hrefstring—Render as link
currentboolean—Current/active style
disabledboolean—Disabled state
activeboolean—Override group active context
horizontalboolean—Override group horizontal context
IconComponent—Leading icon component
typebutton type—When rendered as button
classClassValue—Extra classes
...restbutton / anchor attrs—onclick, etc.

© 2026 Bitblue is a registered trademark. All Rights Reserved.