Add tag() action for CollectionService tags

Adds a built-in `vide.tag()` action that wraps `Instance:AddTag()` /
`Instance:RemoveTag()` so tags can be applied through `create()` props.

It accepts a static string or array of strings, or a reactive source
returning either. The reactive variant diffs the previous and new tag
sets so only the delta is applied. All tags added by the action are
removed when the surrounding scope is destroyed.

Includes mock support for `AddTag`/`RemoveTag`/`HasTag`/`GetTags`,
tests, API reference docs, and a closing note in the actions tutorial.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrea Fletcher 2026-05-26 22:10:47 -07:00
parent 19eaeb424f
commit 18c1d02d43
No known key found for this signature in database
7 changed files with 276 additions and 0 deletions

View file

@ -53,3 +53,8 @@ instance.Text = "foo" -- "foo" will be printed by the effect
The source `output` will be updated with the new property value any time it is
changed externally.
Vide also ships a few common actions out of the box, such as `vide.changed()`
for the pattern above and `vide.tag()` for adding
[CollectionService](https://create.roblox.com/docs/reference/engine/classes/CollectionService)
tags to an instance.