GitHub

Action Buttons

llms.txt

Example

ActionButtons

Individual Buttons

Usage

ActionButtons Container

		
<script lang="ts">
	let liked = $state(false);
	let bookmarked = $state(false);
</script>

<ActionButtons
	reply={{ count: 5, onclick: () => console.log('reply') }}
	repost={{ count: 12, onclick: () => console.log('repost') }}
	like={{ count: 99, active: liked, onclick: () => (liked = !liked) }}
	bookmark={{ active: bookmarked, onclick: () => (bookmarked = !bookmarked) }}
/>

Individual Buttons

Each button can be used standalone:

		
<script lang="ts">
	let liked = $state(false);
</script>

<LikeButton count={42} active={liked} onclick={() => (liked = !liked)} />

State Management

The parent controls the state via active prop. The onclick callback handles toggling:

		
<LikeButton
	count={42}
	active={liked}
	onclick={async () => {
		await api.like(postId);
		liked = !liked;
	}}
/>

API Reference

ActionButtons

Container for social action buttons (reply, repost, like, bookmark).

Property
reply
repost
like
bookmark
customActions
class

ReplyButton

A reply action button with count.

Property
count
onclick
href

RepostButton

A repost action button with count.

Property
count
active
onclick
href

LikeButton

A like toggle button with count.

Property
count
active
onclick
href

BookmarkButton

A bookmark toggle button.

Property
active
onclick