---
title: rules
framework: tvml
role: collectionGroup
path: tvml/rules
---

# rules

Contains the elements used in data binding and media queries.

## Overview

Overview The rules element contains a set of specialize elements that are used to modify existing elements. The specialize elements use data queries to determine how the existing element is modified. Here’s an example that sets the rules for a button element. <rules>     <specialize state="({progress}-greater-than:0) and ({progress}-less-than:1)">         <button tag="button">             <text>Resume</text>         </button>     </specialize>     <specialize state="({progress}:0), ({progress}:1)">         <button tag="button">             <text>Play</text>         </button>     </specialize> </rules> Subelements of rules specialize Elements that Use rules The rules element can used by any other element.

## Topics

### Valid TVML Attributes

- [binding](tvml/binding.md)
- [prototype](tvml/prototype.md)
- [theme](tvml/theme.md)

## See Also

### Binding Elements

- [prototypes](tvml/prototypes.md)
- [specialize](tvml/specialize.md)
