skip section navigation

Tags

Tags displays short category labels that wrap onto another line when needed. use them to help someone scan a collection, not as hidden buttons.

GardeningWeekendsaved for later

usage

svelte
<script>
	import { Tags } from '@ciabi/loafkit-ui';
	const tags = [
		{ name: 'Gardening' },
		{ name: 'Weekend', color: '#F4D89B', textColor: '#30240B' },
		{ name: 'saved for later' }
	];
</script>

<Tags {tags} />

the public Tag type also contains description, href and iconSrc, but Tags doesn’t render those fields. an href in the data won’t turn the label into a link. use ordinary anchors when categories should navigate, or Checklist when people need to select several categories.

API reference

Tags

Component
tags

category labels and supported color overrides.

class
Default: ''

extra classes on the component root.

style

inline styles on the component root.

Tag

Type

one item supplied to Tags.

name

visible category text.

color

CSS background color.

textColor

explicit CSS text color.

description

part of the public data type; not rendered by Tags.

href

part of the public data type; does not make Tags a link.

iconSrc

part of the public data type; not rendered by Tags.