Skip to content
tcpsystemsui

Theme

Colour scheme
Accent
Density
Radius
Esc

Menu

Action menu on the popover API.

beta

Try it

Svelte
<Menu id="playground-menu" label="Deployment actions" items={[{"label":"View deployment","href":"#"},{"label":"Open logs","href":"#"},{"separator":true},{"label":"Delete deployment","tone":"danger"}]} />

Examples

Actions

Actions.svelte
<script lang="ts">
	import Menu from '@tcpsystems/ui/foundation/Menu';
	const uid = $props.id();
</script>

<Menu
	id={uid}
	label="Deployment actions"
	items={[
		{ label: 'View deployment', href: '#' },
		{ label: 'Open logs', href: '#' },
		{ label: 'Redeploy' },
		{ separator: true },
		{ label: 'Delete deployment', tone: 'danger' }
	]}
/>

States and size

States and size.svelte
<script lang="ts">
	import Menu from '@tcpsystems/ui/foundation/Menu';
	import Cluster from '@tcpsystems/ui/foundation/Cluster';
	const uid = $props.id();
	const small = uid + '-small';
	const medium = uid + '-medium';
</script>

<Cluster>
	<Menu
		id={small}
		label="Invoice actions"
		size="sm"
		items={[
			{ label: 'Download PDF', href: '#' },
			{ label: 'Resend receipt', disabled: true },
			{ separator: true },
			{ label: 'Void invoice', tone: 'danger' }
		]}
	/>
	<Menu
		id={medium}
		label="Team member actions"
		size="md"
		icon="settings"
		items={[
			{ label: 'Edit role', href: '#' },
			{ label: 'Reset access' },
			{ label: 'Remove from team', tone: 'danger' }
		]}
	/>
</Cluster>

API

Import
import Menu from '@tcpsystems/ui/foundation/Menu';
PropTypeDefault
idstringnone
labelstringnone
itemsItem[]none
size?'sm' | 'md''sm'
icon?string'more'
HookKind
.tcp-menuRoot class
data-sizeData attribute
data-toneData attribute
data-variantData attribute